+ Post New Thread
Page 1 of 6 12345 ... LastLast
Results 1 to 15 of 81
Windows 7 Thread, Auto join domain using sysprep - Windows 7 in Technical; Hi all, We are quite new to using Windows and Sysprep is a different kettle of fish to the XP ...
  1. #1

    Join Date
    Nov 2009
    Location
    North Walsham
    Posts
    118
    Thank Post
    45
    Thanked 8 Times in 8 Posts
    Rep Power
    11

    Auto join domain using sysprep - Windows 7

    Hi all,

    We are quite new to using Windows and Sysprep is a different kettle of fish to the XP version I am use to.

    I have followed Brian Lee Jacksons Sysprep guide and all works well apart from I am not sure how to get a machine to automatically join the domain?

    Is there a setting in the unattend.xml file or do a need an additional xml file or a vbs script?

    We are using FOG to capture and deploy the image.

    Thanks very much in advance for any help/advice.

    Gary

  2. Thanks to ronnoco from:

    synaesthesia (27th March 2011)

  3. #2
    JaTayler's Avatar
    Join Date
    Dec 2010
    Location
    UK, London
    Posts
    43
    Thank Post
    5
    Thanked 3 Times in 3 Posts
    Rep Power
    8
    Hi ronnoco,

    We deployed Windows 7 to our machines in the summer of 2010 and used a .vbs script that was created for us which joined the machine to the domain automatically - all we need to do is enter the Asset Number of the machine and the script does the rest.

    We initially build a machine with Windows 7 and all the software etc... then copied a folder which contained the script and a little .cmd file, which initialised the script, to c:\windows\setup\scripts\
    Then ran sysprep using the Out-of-box experience (OBE) option & captured the image using GHOST.
    When the machine was built, we ran through the OBE screens until it reboots. Get to the desktop & this little script pops up, we enter the asset number of the machine, click OK and viola, the machine is added to the domain

    If you would like a copy of the script and .cmd file, let me know I can just take out the specific info we have and send it to you.

    Cheers
    J

  4. Thanks to JaTayler from:

    ronnoco (18th March 2011)

  5. #3

    Join Date
    Nov 2009
    Location
    North Walsham
    Posts
    118
    Thank Post
    45
    Thanked 8 Times in 8 Posts
    Rep Power
    11
    Hi,

    Thanks for the quick reply and yes, if you could send me the script that would be great.

    If it can just show me what bits I need to fill in, that would be great!

    Cheers.

    Gary

  6. #4
    EvLPhenom's Avatar
    Join Date
    Apr 2006
    Location
    Sutton Colfield
    Posts
    432
    Thank Post
    21
    Thanked 40 Times in 35 Posts
    Rep Power
    23
    Hi,

    Is there any chance you could send it to me as well as I am just getting to this stage now and it seems like a good way to do it. Thanks in advance.

  7. #5
    JaTayler's Avatar
    Join Date
    Dec 2010
    Location
    UK, London
    Posts
    43
    Thank Post
    5
    Thanked 3 Times in 3 Posts
    Rep Power
    8
    Sent guys.

    Cheers

  8. Thanks to JaTayler from:

    EvLPhenom (18th March 2011)

  9. #6
    EvLPhenom's Avatar
    Join Date
    Apr 2006
    Location
    Sutton Colfield
    Posts
    432
    Thank Post
    21
    Thanked 40 Times in 35 Posts
    Rep Power
    23
    Much appreciated thanks.

  10. #7

    Join Date
    Jan 2011
    Location
    Manchester
    Posts
    104
    Thank Post
    21
    Thanked 4 Times in 4 Posts
    Rep Power
    8
    Hiya,

    Is there any chance this could be sent to me also? Hopefully plan to do this soon and this will be great and soo useful to us. Any help will be greatly appreciated.

    Thanks.
    Mo

  11. #8

    Join Date
    Nov 2009
    Location
    North Walsham
    Posts
    118
    Thank Post
    45
    Thanked 8 Times in 8 Posts
    Rep Power
    11
    Hi J,

    Thanks a lot for sending, will try soon.

    Just checking, do I call the .cmd file joindomain.cmd ?

    Thanks!

    Gary

  12. #9

    Join Date
    Jan 2011
    Location
    Bradford
    Posts
    17
    Thank Post
    1
    Thanked 1 Time in 1 Post
    Rep Power
    0
    could i get a copy too please

    Cheers

  13. #10
    JaTayler's Avatar
    Join Date
    Dec 2010
    Location
    UK, London
    Posts
    43
    Thank Post
    5
    Thanked 3 Times in 3 Posts
    Rep Power
    8
    Hi Gary,
    We've called it setupcomplete.cmd but i assume it could be anything you like.

    I guess it would be a bit of trial and error to see what works.

    Cheers

  14. #11
    JB_IT's Avatar
    Join Date
    Mar 2011
    Posts
    10
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    If you are using a FOG server you can set fog to add the machine to the domain and be put in any OU you specify, which i what i do to then automate software installs of other software which isn't in the image.

  15. #12
    mrtechsystems's Avatar
    Join Date
    Jun 2005
    Location
    Yorkshire
    Posts
    424
    Thank Post
    99
    Thanked 22 Times in 22 Posts
    Rep Power
    25
    Hi JaTayler

    Could do me a favour sent me the script so I can take a look would be useful Cheers

  16. #13
    chrisbrown's Avatar
    Join Date
    Aug 2010
    Location
    Melbourne, Australia
    Posts
    103
    Thank Post
    2
    Thanked 16 Times in 14 Posts
    Rep Power
    17
    Why not put the script in the thread here so everyone can see it?

  17. #14

    Join Date
    Sep 2009
    Posts
    133
    Thank Post
    0
    Thanked 4 Times in 4 Posts
    Rep Power
    11
    Can I have a copy please?

    Thanks!

    Moby

  18. #15
    JaTayler's Avatar
    Join Date
    Dec 2010
    Location
    UK, London
    Posts
    43
    Thank Post
    5
    Thanked 3 Times in 3 Posts
    Rep Power
    8
    Hi Guys, Sorry I haven't been on here for a bit.

    The stuff that you need to change is in red

    Cheers
    J
    -------------------------------------------------------------------------------------------------------------------------
    Code:
    Const JOIN_DOMAIN = 1
    Const ACCT_CREATE = 2
    
    Dim sCmpName
    Dim sUser, sPassword, sDomain, sOU
    
    sUser = ""
    sPassword = ""
    sDomain = "" 
    
    sCmpName = InputBox("Enter the new computer name:", "Computer Name")
    If sCmpName = "" Then
    Wscript.Echo "Exiting script."
    Wscript.Quit
    End If
    
    Dim oWMI, oCmp, oOS, sReturn
    
    Set oWMI = GetObject("winmgmts:\\.\root\cimv2")
    For Each oCmp in oWMI.InstancesOf("Win32_ComputerSystem")
    sReturn = oCmp.Rename(sCmpName)
    If sReturn <> 0 Then
    Wscript.Echo "Rename failed. Error = " & Err.Number & _
    vbcrlf & "Exiting script."
    Else
    Wscript.Echo "Rename successful."
    sReturn = oCmp.JoinDomainOrWorkgroup(sDomain, sPassword, _
    sDomain & "\" & sUser, sOU, JOIN_DOMAIN)
    If sReturn <> 0 Then
    Wscript.Echo "Join domain failed. Error = " & Err.Number & _
    vbcrlf & "Exiting script."
    Else
    Wscript.Echo "Join domain successful."
    End If
    Wscript.Echo "Rebooting computer..."
    Dim oShell
    
    Set oShell = CreateObject("Wscript.Shell")
    sReturn = oShell.Run("%comspec% /c shutdown -r -t 0 -f")
    
    End If
    Next
    -------------------------------------------------------------------------------------------------------------------------
    The script file is saved as JoinDomain.vbs
    The .cmd just contains:

    start c:\windows\setup\scripts\joindomain.vbs

    Both need to be copied into the Windows\Setup\Scripts folder so that they run when the machine logs in after the build

    All the best guys, hope it works for you
    Last edited by ChrisH; 28th March 2011 at 12:45 PM. Reason: Code tags added

SHARE:
+ Post New Thread
Page 1 of 6 12345 ... LastLast

Similar Threads

  1. Replies: 0
    Last Post: 17th February 2011, 02:57 PM
  2. Windows 7 PC won't join server 2008 Domain
    By speckytecky in forum Windows 7
    Replies: 1
    Last Post: 30th September 2010, 12:22 PM
  3. XP SP3 Sysprep Domain Join 'weirdness'
    By _techie_ in forum Windows
    Replies: 2
    Last Post: 20th July 2010, 01:02 PM
  4. Script to join new domain
    By THERADIOTUBBY in forum Windows Server 2008 R2
    Replies: 4
    Last Post: 2nd July 2010, 08:32 AM
  5. No Domain Join during Setup
    By Nick_Parker in forum Windows 7
    Replies: 19
    Last Post: 24th August 2009, 01:13 PM

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
  •