You can use this script to mass create sequentially named computer objects in AD. This is helpful if you pre-stage object before imaging, and they are all named with a common scheme. This script requires the AD PowerShell module. The first variable ($number) should be one less than the starting number, meaning that if your first machine is ABC-01, this variable should equal zero. Second, input your naming scheme on the line that starts with $name. Change the OU path on the new-adcomputer line to reflect the location where the objects should be created. Finally, change the “Until” line to be the last machine, meaning that if I want 1 – 25 created, I would make this line ABC-25.
Import-Module activedirectory
$number = 0
Do {
$number = $number + 1
If ($number -lt 10) {$name = “ABC-0” + “$number”} Else {$name = “ABC-” + “$number”}
new-adcomputer -name $name -SAMAccountName $name -path “ou=accounting,ou=computers,dc=contoso,dc=com”
write-host “created $name”
} Until ($name -eq “ABC-25”)