Damit sollte es klappen:
Spoiler anzeigen
[autoit]
Global $ou = 'Computers'
Global $domain_name = 'musterfirma'
Global $toplevel = 'de'
Global $accountNew = 'AccountName'
Global $strAttrib, $strValue
Global $objCompt = ObjGet("LDAP://cn=" & $ou & ",dc=NA,dc=" & $domain_name & ",dc=" & $toplevel)
Global $objComptCopy = $objCompt.Create("computer", "cn=" & $accountNew)
$objComptCopy.Put("sAMAccountName", $accountNew)
$objComptCopy.SetInfo
$objComptTemplate = ObjGet("LDAP://cn=" & $accountNew & ",cn=" & $ou & ",dc=NA,dc=" & $domain_name & ",dc=" & $toplevel)
Global $arrAttributes[2] = ["description", "location"]
For $strAttrib In $arrAttributes
$strValue = $objComptTemplate.Get($strAttrib)
$objComptCopy.Put($strAttrib, $strValue)
Next
$objComptCopy.SetInfo