There's more...
The Add-Computer PowerShell cmdlet offers many more possibilities.
For instance, the -NewName parameter can be used to provide a new hostname for the device before joining it to the Active Directory domain. This way, you may avoid joining many DESKTOP-XXXXXXX devices to Active Directory, but can definitely avoid the reboot for renaming a device.
Another real gem is the -OUPath parameter, which can be used to specify the OU that the computer object is to be placed in. This is particularly useful when you only have privileges to add computer objects to certain OUs as a delegated admin.
When using Windows PowerShell to automate joining devices to Active Directory, you might want to add the -Restart parameter. When set, the device ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access