Sign in to follow this  
Followers 0
stev379

Move computers to different OU

2 posts in this topic

#1 ·  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

Share this post


Link to post
Share on other sites



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)

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0