Collect and Inject Workgroup name (and Computer Description)
Does anyone know if the workgroup name exists in the registry anywhere? I was looking through the bundled Get/Set Computer Name tasks in the K2000. I thought it would help to spin off more tasks that preserve the workgroup/domain membership and computer description. The location of the computer name is pretty striaghtforward. But I cannot for the life of me find where Windows stores the workgroup name. So I was wondering:
- Does anyone know if/where the workgroup name exists in the registry?
- Is HKLM\System\ControlSet001\Services\LanmanServer\Parameters\srvcomment a reliable place to get the computer description?
- Is testing for the presence of HKLM\System\ControlSet001\Services\Tcpip\Parameters\Domain a reliable way to determine domain membership?
Answers (4)
Workgroup name is stored in the Security hive (HKEY_LOCAL_MACHINE\Security) backed up by the file \windows\system32\config\security. It can only be accessed by privileged processes such as lsass. 2 and 3 are correct
Workgroup name is stored in the Security hive (HKEY_LOCAL_MACHINE\Security) backed up by the file \windows\system32\config\security. It can only be accessed by privileged processes such as lsass.
according to this link http://social.msdn.microsoft.com/Forums/en/embeddedwindowseefs/thread/c0d2bf00-2141-4d10-8e01-aa3804a2f7ec
Comments:
-
Found it. It's at HKLM\Security\Policy\PolPrDmN. Unfortunately, it seems encoded slightly, and it's a REG_NONE type, which no convenient tools support.
A quick google brings some AutoIt UDFs that might help. If that doesn't work, though. I might just give up. - rodoke 11 years ago
Depending on what you are needing it for. In Powershell you can use this. This will output to a .txt file.
(Get-WmiObject -Class Win32_ComputerSystem).workgroup|out-file c:\temp\test.txt
You could also use a variable for further scripting.
$workgroup= (Get-WmiObject -Class Win32_ComputerSystem).workgroup
Comments:
-
Admittedly my Powershell skills aren't the best, but would that work as a PreInstallation task? Can you access WMI on a non-running Windows install? I started out with the registry mostly because accessing it offline is easy. - rodoke 11 years ago
If you are doing a scripted install or sysprep image add it to your answer file
<component name="Microsoft-Windows-UnattendedJoin" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Identification>
<JoinWorkgroup>tmccacad</JoinWorkgroup>
</Identification>
</component>
Comments:
-
Unattend.xml works beautifully when you know what that information will be beforehand, but it doesn't work so well when you don't. I didn't want to just specify a workgroup. I wanted to preserve whatever the workgroup settings were from the last installation on the target machine. I've already been able to preserve the name--Dell even provided sample scripts to do just that. I just wanted to try doing that with the workgroup as well. - rodoke 11 years ago