Windows: Join a workgroup or domain from command line (2024)

Hi,

there are two ways to join or leave a domain. The netdom command or the Powershell 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

C:\> 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.

c:\> netdom remove %computername% /domain:your.OldADDomain.net /force

The Powershell way

Join a Domain

PS C:\> Add-computer -DomainName "your.ADDomainToJoin.net" -Credential LoginWithJoinPermissions 

Remove from Domain and join a workgroup.

PS C:\> Remove-computer -WorkgroupName yourWorkgroup 

Michael

Advertisment to support michlstechblog.info

Leave a Reply

My Knowledgebase for things about Linux, Windows, VMware, Electronic and so on…

Place for Advertisment to support michlstechblog.info

This website uses cookies to improve your experience and to serv personalized advertising by google adsense. By using this website, you consent to the use of cookies for personalized content and advertising. For more information about cookies, please see our Privacy Policy, but you can opt-out if you wish. Accept Reject Read More

Windows: Join a workgroup or domain from command line (2024)
Top Articles
Latest Posts
Article information

Author: Msgr. Benton Quitzon

Last Updated:

Views: 5869

Rating: 4.2 / 5 (43 voted)

Reviews: 82% of readers found this page helpful

Author information

Name: Msgr. Benton Quitzon

Birthday: 2001-08-13

Address: 96487 Kris Cliff, Teresiafurt, WI 95201

Phone: +9418513585781

Job: Senior Designer

Hobby: Calligraphy, Rowing, Vacation, Geocaching, Web surfing, Electronics, Electronics

Introduction: My name is Msgr. Benton Quitzon, I am a comfortable, charming, thankful, happy, adventurous, handsome, precious person who loves writing and wants to share my knowledge and understanding with you.