Jump to content

Windows 7 Sysprep


Recommended Posts

Hiya,

Our environment is Server 2008 R2 WDS with Windows 7 clients. I am trying to build a base image for our machines to blast out to all the others, however i'm stuck at the sysprep stage. This is what I want.

1) Install Windows 7 from WDS onto a PC

2) Install all drivers/applications etc

3) Run sysprep, reboot and re-capture the image

4) Upon reboot, all it does is ask for a computer name and joins it to our domain

1 and 2 are OK, but I cannot work out how to get 3 and 4 to do what they're supposed to. When using the OOBE option in sysprep it reboots and asks for a local username, network location etc. Using the audit option in sysprep just reboots and puts it straight at the logon screen. Neither way puts it in the domain.

Sysprep in XP was so easy so why do Microsoft insist on fixing what isn't broke!

Thanks

Link to comment
Share on other sites


Look into using MDT 2010 for your build engineering - Sysprep in Windows 7 is indeed more complex, but it's also more powerful and is much more flexible. Using a tool like MDT as a front-end removes some of the complexity and makes it easier to create repeatable deployments that do what you want.

I know I answered your question with a "go do this other thing", because while you can modify your unattend.xml to work around some of those things you're still going to run into issues. My response was more of a long-term solution.

Link to comment
Share on other sites

The entire task sequence UI is customizable, for what it's worth - it's just an HTA with wsf scripts behind it. However, if it doesn't work for you, that's perfectly fine. You will need to automate the OOBE via your unattend - I'll ask tripredacus to come have a look at this thread.

Link to comment
Share on other sites

1) Install Windows 7 from WDS onto a PC

2) Install all drivers/applications etc

3) Run sysprep, reboot and re-capture the image

4) Upon reboot, all it does is ask for a computer name and joins it to our domain

I do not use the exact same process as you but, as Cluberti said, you are going to need to make an unattend file. So we can start at step 3. Before you do your sysprep, you need to make an XML file with WSIM. This program is included in the WAIK (Windows Automated Install Kit) for Windows 7. Technically you could use a Vista unattend file, but some of the settings do not work in Windows 7. You can get the WAIK here:

http://www.microsoft.com/downloads/details.aspx?FamilyID=696dd665-9f76-4177-a811-39c26d3b3b34&displaylang=en

You install this on your Technician PC, aka some computer that you do your dev work on. The Technician PC is not the one you are making the images on! You open up WSIM, and the first thing it wants to do is find a catalog file. You will need to insert your source Windows 7 DVD and choose the appropriate CLG from the Sources folder. After this, you choose to create a new Unattend file.

Some examples of unattend files are here:

Since you will be applying your XML from the OS (as opposed to during install) you do not need all everything. The only ones you should probably worry about is what is in the Specialize and oobeSystem passes. Since you are new to making this file, you may want to approach your image creation the way I set up my systems for testing. Here is what I do:

1. I install Win7 with an unattend file from the DVD to put the OS into Audit Mode.

2. Then I install any drivers or programs I want to use.

>>> it is at this point that I want to preserve an image for testing so that I do not have to redo all this work.

3. Run sysprep /generalize /audit /shutdown

4. Capture the image to the server, call it w7audit.wim.

5. Boot the machine up again. Copy my XML file I made for sysprep and put it in c:\windows\system32\sysprep.

6. Run sysprep.exe /oobe /restart /unattend:c:\windows\system32\sysprep\sysprep.xml

Now at step 6 I can test to verify that my unattend/sysprep.xml file works properly. If it does not work, I simply redeploy the audit image I captured, make some changes to the xml and try again. So let's say that my XML is working the way I want it to, I need to capture the master image:

7. Run sysprep.exe /oobe /generalize /shutdown /unattend:c:\windows\system32\sysprep\sysprep.xml

8. Capture the image to the server, call it install.wim or w7oobe.wim

9. Redeploy the oobe image to machines.

:ph34r:

Link to comment
Share on other sites

Thanks! I've been trying all day but I cannot get 2 things to work:

1) Prompt for a computer name (it's randomly generating one), despite my XML file not having the ComputerName entry at all

2) Disable the prompt for a local username

Both happen if I try and do it the WDS/WSIM native way, and point 2 happens if I use MDT to deploy then sysprep before capture.

Point 2 actually breaks the domain join as its joining the domain with the randomly generated computer name, yet when having to add a local username it renames the PC so you can't logon to the domain anyway.

Help!!

Thanks

Edited by ldoodle
Link to comment
Share on other sites

Can you attach your XML as a file to your post? Make sure to edit out the product key if it is in there.

Just to confirm, this is what i'm currently doing with the native WDS deployment service:

1) Install Windows 7 Pro from WDS in attended mode

2) When it gets to it's first prompt screen, i'm hitting Shift+Ctrl+F3 to reboot into Audit mode

3) Make any customizations (drivers, applications, joining domain etc) - when first entering Audit mode you get the Sysprep tool open, and it opens each time you reboot while in Audit mode

4) This is where i'm stuck. I first tried just using the Sysprep GUI with OOBE selected and Generalize ticked, hoping it would 'remember' domain settings etc from Audit mode.

Do I need to come out of the GUI and supply an .xml file to a Sysprep command line? If so what's the point in joining a domain when in Audit mode, as I've read on the MS website that this is how it should be done.

Edited by ldoodle
Link to comment
Share on other sites

You don't join the domain in Audit mode. The join should happen during First Logon after Windows Setup. You can just use the sysprep GUI if you want. Then name your file UNATTEND.XML and put it in one of the search locations:

http://technet.microsoft.com/en-us/library/cc749415%28WS.10%29.aspx

Otherwise, in order to use the commands I posted, you need to close the sysprep box that shows up. Otherwise you will get an error saying that sysprep is already open. I don't really like using the method of sysprep looking for the file. I'd rather specify it myself.

Link to comment
Share on other sites

You don't join the domain in Audit mode. The join should happen during First Logon after Windows Setup. You can just use the sysprep GUI if you want. Then name your file UNATTEND.XML and put it in one of the search locations:

http://technet.microsoft.com/en-us/library/cc749415%28WS.10%29.aspx

Otherwise, in order to use the commands I posted, you need to close the sysprep box that shows up. Otherwise you will get an error saying that sysprep is already open. I don't really like using the method of sysprep looking for the file. I'd rather specify it myself.

Thanks for all you help!

So, I need to create an answer file for sysprep. I suppose the best thing would be the run sysprep with the gui without an answer file and go through the prompts and then I can add these to the unnatended file, so i'm only adding what needs to be added.

When you say the domain join is done after first logon, that means I need to have an auto logon setting in the answer file which then runs netdom. What do I do about naming the computer? I suppose i'll have to script something that prompts for a computer name then joins the domain.

This is a very long winded method compared to XP's sysprep mini setup process. Talking about going backwards Microsoft!

Link to comment
Share on other sites

You don't join the domain in Audit mode. The join should happen during First Logon after Windows Setup. You can just use the sysprep GUI if you want. Then name your file UNATTEND.XML and put it in one of the search locations:

http://technet.microsoft.com/en-us/library/cc749415%28WS.10%29.aspx

Otherwise, in order to use the commands I posted, you need to close the sysprep box that shows up. Otherwise you will get an error saying that sysprep is already open. I don't really like using the method of sysprep looking for the file. I'd rather specify it myself.

Thanks for all you help!

So, I need to create an answer file for sysprep. I suppose the best thing would be the run sysprep with the gui without an answer file and go through the prompts and then I can add these to the unnatended file, so i'm only adding what needs to be added.

When you say the domain join is done after first logon, that means I need to have an auto logon setting in the answer file which then runs netdom. What do I do about naming the computer? I suppose i'll have to script something that prompts for a computer name then joins the domain.

This is a very long winded method compared to XP's sysprep mini setup process. Talking about going backwards Microsoft!

OK seem to be getting somewhere. However it still prompts for a local user account, which then changes the computer name. I have added a new local user account in the unattend.xml file and this seems to get round it, so just wondering if this is correct. I'm also enabling the local admin account but this doesn't seem to be enough.

Does that sound right?

Link to comment
Share on other sites

I'm not too sure about the behaviour of unattends in domain environments. I do know that you can't log into the domain and then do the join. The PC needs to join then you can login. Does this help? Maybe also you can pre-stage the system in AD to get it to join that way, not sure.

Link to comment
Share on other sites

Maybe also you can pre-stage the system in AD to get it to join that way, not sure.

This is exactly what i've done. I've created an unattend file using the appropriate varibales (%MACHINENAME%) etc for things like computer name, domain name etc. This way I get a truly unattended vanilla install, after which I install my apps, drivers etc, then run sysprep. Once the custom image is captured to the WDS server, I apply the same unattend file which uses the computer name I used when pre-staging it in AD, and all works OK.

Thanks for all your help. If I had thought about pre-staging I could have got it done a hell of a lot quicker, but you always forget about the simplest solution!

Edited by ldoodle
Link to comment
Share on other sites

Yes well pre-staging can be helpful in certain situations. It depends on what your environment is like. For example, pre-staging doesn't work for me, but if I were doing it for an enterprise environment with appropriate inventory collection, I would definately use pre-staging.

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...