E1M1 Posted September 18, 2009 Share Posted September 18, 2009 does anyone know how to to make script that changes workgroup? I prefer regedit or command line method. edited Link to comment Share on other sites More sharing options...
ctyankeeinok Posted September 18, 2009 Share Posted September 18, 2009 I have done it by going thru My Computer. - but not by command line or registry. Link to comment Share on other sites More sharing options...
ctyankeeinok Posted September 18, 2009 Share Posted September 18, 2009 Google your problem (rename workgroup command line). You can use netdom.exe from windows Server 2003 to rename a computer with a command line. you may have to install it on each computer. I have not tried this method - YMMV. Link to comment Share on other sites More sharing options...
Juvigy Posted September 21, 2009 Share Posted September 21, 2009 What i do is Fileinstall() NetDom.exe and then use the : $path="netdom join "& @ComputerName & " /domain:mydomain /userd:adminuser /passwordd:adminpassword" RunWait(@ComSpec & ' /c ' & $path) This is the domainjoin. You can type "netdom /?" in cmd to check for workgroup. Link to comment Share on other sites More sharing options...
99ojo Posted September 21, 2009 Share Posted September 21, 2009 What i do is Fileinstall() NetDom.exe and then use the : $path="netdom join "& @ComputerName & " /domain:mydomain /userd:adminuser /passwordd:adminpassword" RunWait(@ComSpec & ' /c ' & $path) This is the domainjoin. You can type "netdom /?" in cmd to check for workgroup. Hi, here is the WMI Solution: $strComputer = "localhost" $newworkgroup = "WORKGROUP" $objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\CIMV2") For $computersystem In $objWMIService.InstancesOf("Win32_ComputerSystem") $computersystem.JoinDomainOrWorkgroup ($newworkgroup) Next You have to reboot machine to make changes effect. ;-)) Stefan Link to comment Share on other sites More sharing options...
ctyankeeinok Posted September 21, 2009 Share Posted September 21, 2009 Thanks Stefan - I also found out how to rename the computer through WMI using $computersystem.Rename($newcompname) , but what about the Computer Description? How can that be changed? Link to comment Share on other sites More sharing options...
99ojo Posted September 21, 2009 Share Posted September 21, 2009 Thanks Stefan - I also found out how to rename the computer through WMI using $computersystem.Rename($newcompname) , but what about the Computer Description? How can that be changed? Hi, $strComputer = "localhost" $strNewdescription = "Test" $objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\CIMV2") For $objitem In $objWMIService.InstancesOf("Win32_OperatingSystem") $objitem.Description =$strNewdescription $objitem.Put_ () Next or alternate RegWrite ("HKLM\SYSTEM\CurrentControlSet\Services\Lanmanserver\parameters", "srvcomment", "REG_SZ", $strNewdescription) ;-)) Stefan Link to comment Share on other sites More sharing options...
ctyankeeinok Posted September 21, 2009 Share Posted September 21, 2009 Very Cool. Thank you! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now