hello
i want to get workgroup of the computer without using unmanaged code
i try this
System.Environment.UserDomainName
but its giving me the COMPUTER NAME not the workgroup ... is there any way to find out using System.NET or WMI
thanx any way ..
hello
i want to get workgroup of the computer without using unmanaged code
i try this
System.Environment.UserDomainName
but its giving me the COMPUTER NAME not the workgroup ... is there any way to find out using System.NET or WMI
thanx any way ..
How to get workgroup of the computer?
ScottRogersGBR
Kevin Rodgers
ddani
ewjonker
If that doesn't work, you should be able to use the WMI tools in the System.Management namespace (located in system.management.dll).
sample code.
SelectQuery query = new SelectQuery("Win32_ComputerSystem");
ManagementObjectSearcher searcher = new ManagementObjectSearcher(query);
foreach (ManagementObject mo in searcher.Get())
{
workGroupName = mo["Workgroup"] as string;
}
Shadamus
Try this, or something like it:
My
.Computer.Registry.LocalMachine.OpenSubKey("System\CurrentControlSet\Services\Tcpip\Parameters\", False).GetValue("Domain")