+ Post New Thread
Results 1 to 10 of 10
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 ...
  1. #1

    Join Date
    May 2008
    Posts
    518
    Thank Post
    18
    Thanked 8 Times in 8 Posts
    Rep Power
    15

    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.

    Thanks

  2. #2

    powdarrmonkey's Avatar
    Join Date
    Feb 2008
    Location
    Alcester, Warwickshire
    Posts
    4,859
    Thank Post
    412
    Thanked 777 Times in 650 Posts
    Rep Power
    182
    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.

  3. Thanks to powdarrmonkey from:

    tech_guy (31st October 2008)

  4. #3

    Join Date
    Mar 2007
    Posts
    1,750
    Thank Post
    79
    Thanked 288 Times in 219 Posts
    Rep Power
    70
    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.

  5. #4

    Join Date
    May 2008
    Posts
    518
    Thank Post
    18
    Thanked 8 Times in 8 Posts
    Rep Power
    15
    Thanks that would be great. Can you just copy and paste on here?

  6. #5

    Join Date
    Mar 2007
    Posts
    1,750
    Thank Post
    79
    Thanked 288 Times in 219 Posts
    Rep Power
    70
    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

  7. #6

    Join Date
    May 2008
    Posts
    518
    Thank Post
    18
    Thanked 8 Times in 8 Posts
    Rep Power
    15
    so would i set this script to run in sysprep?

  8. #7

    Join Date
    Mar 2007
    Posts
    1,750
    Thank Post
    79
    Thanked 288 Times in 219 Posts
    Rep Power
    70
    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.

  9. #8

    Join Date
    Jul 2009
    Location
    uk
    Posts
    1
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    management wizard does it for you

    you can specify OU in the management wizard.
    or in identification section of inf file, specify OU

  10. #9
    philterx's Avatar
    Join Date
    Jun 2009
    Location
    Gold Coast
    Posts
    14
    Thank Post
    0
    Thanked 2 Times in 2 Posts
    Blog Entries
    1
    Rep Power
    11
    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

  11. #10

    Geoff's Avatar
    Join Date
    Jun 2005
    Location
    Fylde, Lancs, UK.
    Posts
    11,802
    Thank Post
    110
    Thanked 583 Times in 504 Posts
    Blog Entries
    1
    Rep Power
    224
    Also check if your imaging software will do this for you. I know Ghost and FOG can.

SHARE:
+ Post New Thread

Similar Threads

  1. Replies: 13
    Last Post: 30th June 2009, 04:23 PM
  2. add backup
    By alonebfg in forum EduGeek Joomla 1.5 Package
    Replies: 2
    Last Post: 24th August 2008, 03:07 PM
  3. Please add your site
    By Ric_ in forum EduGeek Joomla 1.0 Package
    Replies: 28
    Last Post: 14th May 2008, 08:17 PM
  4. Computer hangs at 'Applying Computer Settings'
    By crc-ict in forum Wireless Networks
    Replies: 8
    Last Post: 25th April 2008, 10:29 PM
  5. add an application
    By colin in forum Learning Network Manager
    Replies: 6
    Last Post: 20th December 2006, 11:57 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •