Windows: Join a work-group or domain from command line

Windows: Join a work-group or domain from command line


there are two ways to join or leave a domain. The netdom command or the Power shell Command lets add-computer and remove-computer.

The netdom way
Join a domain. If you are logged on at the machine you want to join
1C:\> netdom join %computername% /domain:your.ADDomainToJoin.net /UserD:LoginWithJoinPermissions /PasswordD:*
Remove from Domain and join a workgroup. The /force option disjoins the computer from the domain even if you to not have the permission to remove the computer object from the domain. The domain computer object remains.
1c:\> netdom remove %computername% /domain:your.OldADDomain.net /force
The Powershell way
Join a Domain
1PS C:\> Add-computer -DomainName "your.ADDomainToJoin.net" -CredentialLoginWithJoinPermissions
Remove from Domain and join a workgroup.
1PS C:\> Remove-computer -WorkgroupName yourWorkgroup

No comments:

Post a Comment

Default Observed on Cisco Switches

Speed Port Cost Comment 10 Mbps 100 Ethernet 20 Mbps 56 EtherChannel 30 Mbps 47 EtherChannel 40 Mbps 41 EtherChannel 50 Mbps 35 E...