Creating computer objects
When a desktop computer or member server is joined to a domain, it will create a computer object in AD.
This computer object can be created before being added to the domain. This will not add the device to the domain, but it can be used with offline domain joins and RODC domain joins.
In order to create a computer object, we can use the New-ADComputer
cmdlet. To view the complete syntax of the command, use this:
Get-Command New-ADComputer -Syntax
The attribute you need to create a computer object is -Name
:
New-ADComputer -Name "REBEL-PC-01" -SamAccountName "REBEL-PC-01" -Path "OU=Computers,OU=Europe,DC=rebeladmin,DC=com"
In the preceding example, the command will create the REBEL-PC01
computer object in the OU=Computers,OU=Europe,DC=rebeladmin,DC=com
OU. If you do not define the path, it will create the object under the default computer container, CN=Computers
, DC=rebeladmin
, DC=com
.
We very rarely...