Login | |
|
 |
RE: Move Computer Account - 8/8/2006 9:35:22 PM
|
|
 |
|
| |
cjwallace
Posts: 491
Score: 0
Joined: 3/5/2005
From: United Kingdom
Status: offline
|
in fact i have this old script i forgot about ===================== Set objNetwork = CreateObject("WScript.Network") strComputer = objNetwork.ComputerName Set objComputer = GetObject("winmgmts:{impersonationLevel=Impersonate}!\\" & _ strComputer & "\root\cimv2:Win32_ComputerSystem.Name='" & _ strComputer & "'") Set objOU = GetObject("LDAP://OU=WORKSTATIONS,OU=LONDON,OU=WORKSTATIONS,OU=EUROPE,OU=WITHERS,DC=WITHERS,DC=NET") intReturn = objOU.MoveHere _ ("LDAP://CN="& strComputer &",OU=LONDON WORKSTATIONS,OU=WITHERS WORKSTATIONS,DC=WITHERS,DC=NET", vbNullString) =================== So with the above information does anyone know how i might get the script to go out and find the workstation and move it from its current OU to the OU that i want? Many thanks
|
|
| |
|
|
|
 |
RE: Move Computer Account - 8/8/2006 9:51:15 PM
|
|
 |
|
| |
Snipah
Posts: 1343
Score: 6
Joined: 11/1/2004
From: Netherlands
Status: offline
|
Let me understand it better: The script needs to know at logintime, where he is configured, and if it equals a certain pattern, MoveIt to a defined container.... S.
_____________________________
For more information, please see the "Read me First" topic. http://www.visualbasicscript.com
|
|
| |
|
|
|
 |
RE: Move Computer Account - 8/9/2006 12:35:44 AM
|
|
 |
|
| |
Snipah
Posts: 1343
Score: 6
Joined: 11/1/2004
From: Netherlands
Status: offline
|
quick addon to your script: objCommand.CommandText = _ "SELECT ADsPath FROM 'LDAP://dc=WITHERS,dc=NET' WHERE objectCategory='computer' AND name='" & strComputer & "'"
_____________________________
For more information, please see the "Read me First" topic. http://www.visualbasicscript.com
|
|
| |
|
|
|
 |
RE: Move Computer Account - 8/9/2006 1:58:27 AM
|
|
 |
|
| |
Snipah
Posts: 1343
Score: 6
Joined: 11/1/2004
From: Netherlands
Status: offline
|
double post?? let me know which one to remove
_____________________________
For more information, please see the "Read me First" topic. http://www.visualbasicscript.com
|
|
| |
|
|
|
 |
RE: Move Computer Account - 8/9/2006 6:11:04 AM
|
|
 |
|
| |
Snipah
Posts: 1343
Score: 6
Joined: 11/1/2004
From: Netherlands
Status: offline
|
Select Case OU Case "VLAN10" objComputer.Put "Location" , "VLAN10 3rd Floor" objComputer.SetInfo Case "VLAN21" objComputer.Put "Location" , "VLAN21 1st Floor" objComputer.SetInfo End Select
_____________________________
For more information, please see the "Read me First" topic. http://www.visualbasicscript.com
|
|
| |
|
|
|
|
|