You have to modify the orange text in the script to your AD dn. If you remove this part computers will be created in the "Computers" OU.
Powershell Script
import-module Activedirectoryimport-csv "C:\PSScripts\Computer.csv" | foreach-object{
$name = $_.Name
$MAC = $_.Mac
$CheckExists = get-adobject -Filter {(ObjectClass -eq "computer") -and (Name -eq $name)} #it´s $NULL if the computer doesn´t exist
if ($CheckExists -eq $NULL){
[guid]$nbGUID = "00000000-0000-0000-0000-$MAC" # transform MAC to netbootGUID
new-adcomputer -Name $name -SamAccountName $name -Path "OU=Systems,DC=directoryadmin,DC=blogspot,DC=com" -OtherAttributes @{'netbootGUID'=$nbGUID}
write-host $name " - " $nbGUID
}
else {
write-host "$name already in use."
}
}
Computer.csv located in C:\PSScripts\
Name,Maccomputer1,A088B44642A8
computer2,A088A44642B8