Joining a domain with Powershell

quick scripts to join an AD domain

Thu, 04 Oct 2018

Just wanted to share my favorite settings for the powershell Add-Computer command. The options I always specify are the domain name(required), credential(required), OUPath to put my computer in its proper AD container, NewName to set the computer name to the proper string, Restart and Force just to save myself from having to restart. The command is listed below

Add-Computer -DomainName "" -OUPath "OU=Desktops,DC=mydomain,DC=com" -NewName "publicDesktop" -credential "mydomain\administrator" -restart -force
Buy Me A CoffeeDigitalOcean Referral Badge
Edward Beazer

Edward Beazer - I just like to build shit. Sometimes I get stuck for hours, even days while trying to figure out how to solve an issue or implement a new feature. Hope my tips and tutorials can save you some time.