You can use Add-Computer PowerShell cmdlet to add a computer to Workgroup. Using the same cmdlet, you can also add a computer to an Active Directory domain.
To join local computer to workgroup, type below command in a Windows PowerShell session:
- Add-Computer -WorkGroupName MyWorkGroup
Above command adds local computer to MyWorkGroup workgroup.
About Nirmal Sharma
Nirmal is a MCSEx3, MCITP and was awarded Microsoft MVP award in Directory Services. He is specialized in Directory Services, Microsoft Clustering, Hyper-V, SQL and Exchange and has been involved in Microsoft Technologies since 1994. In his spare time, he offers technical help by writing tips and articles. Nirmal can be reached at nirmal_sharma@mvps.org.