Jump to content

Recommended Posts

Posted (edited)

I have an old VBScript that moves PC from one OU to another. I attempted to convert to AutoIT, but am obviously missing something so simple I'll be embarrassed I asked.

Any ideas?

$CompName = "Testmachine01"

$objNewOU = ObjGet("LDAP://OU=Computers,OU=COMPANY,OU=ad,DC=SITE,DC=gov")

$objMoveComputer = $objNewOU.MoveHere _

("LDAP://CN=" & $CompName & ",OU=TEST,OU=Computers,OU=COMPANY,OU=ad,DC=SITE,DC=gov", "CN=" & $CompName)

EDIT: I get this error

$objMoveComputer = $objNewOU^ ERROR

(8) : ==> Variable must be of type "Object".:

Thanks!!

-Steve

Edited by stev379
Posted

gov", "CN

shouldn't that comma be inside your " " ?

("LDAP://CN=" & $CompName & ",OU=TEST,OU=Computers,OU=COMPANY,OU=ad,DC=SITE,DC=gov, CN=" & $CompName)

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...