Windows Thread, Add computer to OU once sysprep'd in Technical; Does anyone know of a way to automatically move or add a new computer to a specific OU during sysprep ...
31st October 2008, 11:45 AM #1
- Rep Power
Add computer to OU once sysprep'd
Does anyone know of a way to automatically move or add a new computer to a specific OU during sysprep once a computer has been sysprep'd? Instead of doing it manually ising AD Users and Computers.
At the moment all i have to when sysprep runs is type a computer name. The rest automatically joins it to a domain and sets the settings etc.
It would be nice so that it would move to the correct OU then run gpupdate so it picks up the correct GPOs on boot up.
IDG Tech News
31st October 2008, 11:50 AM #2
Pre-create your accounts in AD in the right place, and then when you join the domain it will connect to your pre-created account.
Thanks to powdarrmonkey from:
tech_guy (31st October 2008)
31st October 2008, 12:07 PM #3
i use a vbs script on boot to find the computer whereever it may be and place it in the ou of your choice.
happy to mail it accross.
31st October 2008, 12:09 PM #4
- Rep Power
Thanks that would be great. Can you just copy and paste on here?
31st October 2008, 12:25 PM #5
On Error Resume Next
Const ADS_SCOPE_SUBTREE = 2
Set WshNetwork = WScript.CreateObject("WScript.Network")
set objOU = GetObject("LDAP://ou=Maxdata desktops,ou=ICT SUITES,ou=Computers,ou=school name,dc=curriculum,dc=local")
Set objConnection = CreateObject("ADODB.Connection")
Set objCommand = CreateObject("ADODB.Command")
objConnection.Provider = "ADsDSOObject"
objConnection.Open "Active Directory Provider"
Set objCommand.ActiveConnection = objConnection
objCommand.Properties("Page Size") = 1000
objCommand.Properties("Searchscope") = ADS_SCOPE_SUBTREE
objCommand.CommandText = _
"SELECT ADsPath FROM 'LDAP://dc=curriculum,dc=local' WHERE objectCategory='computer' " & _
"AND Name='" & wshNetwork.ComputerName & "'"
Wscript.Echo " " & wshNetwork.ComputerName
Set objRecordSet = objCommand.Execute
Do Until objRecordSet.EOF
strADsPath = objRecordSet.Fields("ADsPath").Value
objOU.MoveHere strADsPath, vbNullString
31st October 2008, 12:35 PM #6
- Rep Power
so would i set this script to run in sysprep?
31st October 2008, 12:37 PM #7
copy it to the desktop and set it to autologon. You can also use it to do things like set environment variables.
once logged on you just run the script.
7th July 2009, 08:37 AM #8
- Rep Power
management wizard does it for you
you can specify OU in the management wizard.
or in identification section of inf file, specify OU
8th July 2009, 05:40 AM #9
Back in the day before altiris I used Workstation Name Changer - wsnames.exe to get my machines setup.
But yeah if you have a vbs script and want it to run at first start up and disappear put a path to script in registry under local machine in 'run once'.
Normally I have the script sit on c: drive 'wsnames' or in Windows directory.
8th July 2009, 10:03 AM #10
Also check if your imaging software will do this for you. I know Ghost and FOG can.
Last Post: 30th June 2009, 05:23 PM
By alonebfg in forum EduGeek Joomla 1.5 Package
Last Post: 24th August 2008, 04:07 PM
By Ric_ in forum EduGeek Joomla 1.0 Package
Last Post: 14th May 2008, 09:17 PM
By crc-ict in forum Wireless Networks
Last Post: 25th April 2008, 11:29 PM
By colin in forum Learning Network Manager
Last Post: 20th December 2006, 12:57 PM
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)