Page 1 of 1

moving computers into varible OU's

Posted: Thu Jun 07, 2007 4:46 am
by matrix101
Hello,I'm new to vbscript and am trying to figure out how to write a vbscript that will: move all computers in the computer container beginning with CSC to a specific OU named Corp-SD and/or all computers beginning wth DAL to the DAL-SD OU.I'm using a basic script Microsoft put out:Set objNewOU = GetObject("LDAP://OU=CORP-SD, OU=Workstations, OU=Managed Objects, dc=corp, DC=jitb, DC=net")Set objMoveComputer = objNewOU.MoveHere _ ("LDAP://CN=CSC*, CN=Computers, dc=corp, DC=jitb, DC=net", _ "CN=CSC*")This script works fine as long as your specify the computer name. All computers that belong in the CORP-SD OU start with CSC so I wanted to do something like CSC* but it didn't work. Any Ideas???Thx!

moving computers into varible OU's

Posted: Thu Jun 07, 2007 4:46 am
by matrix101
Hello,I'm new to vbscript and am trying to figure out how to write a vbscript that will: move all computers in the computer container beginning with CSC to a specific OU named Corp-SD and/or all computers beginning wth DAL to the DAL-SD OU.I'm using a basic script Microsoft put out:Set objNewOU = GetObject("LDAP://OU=CORP-SD, OU=Workstations, OU=Managed Objects, dc=corp, DC=jitb, DC=net")Set objMoveComputer = objNewOU.MoveHere _ ("LDAP://CN=CSC*, CN=Computers, dc=corp, DC=jitb, DC=net", _ "CN=CSC*")This script works fine as long as your specify the computer name. All computers that belong in the CORP-SD OU start with CSC so I wanted to do something like CSC* but it didn't work. Any Ideas???Thx!