# show current computer list
PS C:\Users\Administrator> Get-ADComputer -Filter * | Format-Table DistinguishedName
DistinguishedName
-----------------
CN=FD3S,OU=Domain Controllers,DC=srv,DC=world
# for example, add a computer [RX-0]
PS C:\Users\Administrator> New-ADComputer -Name RX-0
# verify
PS C:\Users\Administrator> Get-ADComputer -Filter * | Format-Table DistinguishedName
DistinguishedName
-----------------
CN=FD3S,OU=Domain Controllers,DC=srv,DC=world
CN=RX-0,CN=Computers,DC=srv,DC=world
# to specify OU, run like follows
PS C:\Users\Administrator> New-ADComputer -Name RX-7 `
-Path "OU=Computers,OU=Hiroshima,DC=srv,DC=world"
# if you'd like to add a specific user who can authenticate to AD when computer joins, set like follows
PS C:\Users\Administrator> dsacls "CN=RX-0,CN=Computers,DC=srv,DC=world" /G FD3S01\ADUser01:CALCGRSDDTRC;
# to delete computer accounts, run like follows
PS C:\Users\Administrator> Remove-ADComputer -Identity "CN=RX-7,OU=Computers,OU=Hiroshima,DC=srv,DC=world"
Confirm
Are you sure you want to perform this action?
Performing the operation "Remove" on target "CN=RX-7,OU=Computers,OU=Hiroshima,DC=srv,DC=world".
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): Y
|