How to Change a Workgroup Name on Windows Home Server 2011 and Windows Storage Server 2011 R2 Essentials
Background
On Windows Home Server 2011 and Windows Storage Server 2011 R2 Essentials, the default UI in computer management for changing work group name is grayed out. This wiki aims to provide you PowerShell scripts to change the workgroup name on Windows Home Server 2011 and Windows Storage Server 2011 R2 Essentials.
Please note, Windows Storage Server 2011 R2 Essentials supports domain join, if you want to join your Windows Storage Server 2011 R2 Essentials to a domain, please use the “Domain” settings page in dashboard. This PowerShell scripts only applies to the servers which are not part of a domain, if your server already joined a domain, please DO NOT use this script.
To change workgroup
- open elevated PowerShell window
- issue the following commands in the opened PowerShell window, where workgroupname is the new work group name you want to join to:
$sysinfo = Get-WmiObject Win32_ComputerSystem
$sysinfo.JoinDomainOrWorkgroup("workgroupname")
Possible Error handling
If the return value of above scripts aren’t equals to 0, it means the change isn’t successful and most probably it’s because the name provided is invalid, try remove the special characters and spaces then try again.