techie08 Posted October 31, 2008 Posted October 31, 2008 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. Thanks
powdarrmonkey Posted October 31, 2008 Posted October 31, 2008 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. 1
strawberry Posted October 31, 2008 Posted October 31, 2008 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.
techie08 Posted October 31, 2008 Author Posted October 31, 2008 Thanks that would be great. Can you just copy and paste on here?
strawberry Posted October 31, 2008 Posted October 31, 2008 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 objRecordSet.MoveFirst Do Until objRecordSet.EOF strADsPath = objRecordSet.Fields("ADsPath").Value objOU.MoveHere strADsPath, vbNullString objRecordSet.MoveNext Loop
techie08 Posted October 31, 2008 Author Posted October 31, 2008 so would i set this script to run in sysprep?
strawberry Posted October 31, 2008 Posted October 31, 2008 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.
thejackr Posted July 7, 2009 Posted July 7, 2009 you can specify OU in the management wizard. or in identification section of inf file, specify OU
philterx Posted July 8, 2009 Posted July 8, 2009 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. Cheers, Phil
Geoff Posted July 8, 2009 Posted July 8, 2009 Also check if your imaging software will do this for you. I know Ghost and FOG can.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now