Jump to content

sysprep - unattended


Recommended Posts

I have created a windows 7 install that I want to now sysprep with an unattended file to be able to use that image on multiple machines with our volume license. The problem I'm having is that when I run sysprep (sysprep.exe /generalize /oobe /shutdown /unattend:C:\Autounattended.xml) it runs then shuts down like it should. When I reboot it starts and loading but then I get

Windows could not parse or process the unattend file for pass [specialize]. The settings in the answer file cannot be applied. The error was detected while processing settings for component [Microsoft-Windows-Shell-Setup].

I have the admin account already setup with the Windows install and 1 other user, so I want to be able to skip the option to create a user but I do want to give the pc a name when the computer starts up the setup process.

Here is my unattend file:

<?xml version="1.0" encoding="utf-8"?>

<unattend xmlns="urn:schemas-microsoft-com:unattend">

<settings pass="specialize">

<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<RegisteredOrganization>Organization</RegisteredOrganization>

<RegisteredOwner>Owner</RegisteredOwner>

<TimeZone>Eastern</TimeZone>

<ProductKey>A Serial Number</ProductKey>

<DisableAutoDaylightTimeSet>false</DisableAutoDaylightTimeSet>

<DoNotCleanTaskBar>false</DoNotCleanTaskBar>

<StartPanelOff>false</StartPanelOff>

<ShowWindowsLive>false</ShowWindowsLive>

<CopyProfile>false</CopyProfile>

<BluetoothTaskbarIconEnabled>false</BluetoothTaskbarIconEnabled>

</component>

</settings>

<settings pass="generalize">

<component name="Microsoft-Windows-Security-SPP" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<SkipRearm>1</SkipRearm>

</component>

</settings>

<settings pass="oobeSystem">

<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<OOBE>

<SkipUserOOBE>true</SkipUserOOBE>

<HideEULAPage>false</HideEULAPage>

<HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE>

<NetworkLocation>Work</NetworkLocation>

<SkipMachineOOBE>false</SkipMachineOOBE>

</OOBE>

<TimeZone>Eastern</TimeZone>

<RegisteredOrganization>Organization</RegisteredOrganization>

<RegisteredOwner>Owner</RegisteredOwner>

<DisableAutoDaylightTimeSet>false</DisableAutoDaylightTimeSet>

<BluetoothTaskbarIconEnabled>false</BluetoothTaskbarIconEnabled>

<DoNotCleanTaskBar>false</DoNotCleanTaskBar>

<ShowWindowsLive>false</ShowWindowsLive>

<StartPanelOff>false</StartPanelOff>

</component>

</settings>

<cpi:offlineImage cpi:source="wim:c:/users/csu/documents/windows%207%20files/sources/install.wim#Windows 7 ENTERPRISE" xmlns:cpi="urn:schemas-microsoft-com:cpi" />

</unattend>

Link to comment
Share on other sites


Fix your Timezone - Report Back

<TimeZone>Eastern</TimeZone>

<TimeZone>Eastern Standard Time</TimeZone>

For future readers, you must match the timezone naming syntax found in this registry tree

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones

Edited by MrJinje
Link to comment
Share on other sites

Fix your Timezone - Report Back

<TimeZone>Eastern</TimeZone>

<TimeZone>Eastern Standard Time</TimeZone>

For future readers, you must match the timezone naming syntax found in this registry tree

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones

Same results. I came up with another unattend file that I found online that sorta works but I have a question. I need to be able to run the setup to add a computer name but I don't want to have to setup a user name since I already created a user account that I want to use when the image was setup.

<unattend>

<settings pass="windowsPE">

<component name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">

<SetupUILanguage>

<UILanguage>en-US</UILanguage>

</SetupUILanguage>

<InputLocale>0409:00000409</InputLocale>

<UserLocale>en-US</UserLocale>

<UILanguage>en-US</UILanguage>

<SystemLocale>en-US</SystemLocale>

</component>

<component name="Microsoft-Windows-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">

<UserData>

<AcceptEula>true</AcceptEula>

<FullName>name</FullName>

<Organization>name</Organization>

<ProductKey>

<Key>Serial Number</Key>

<WillShowUI>Never</WillShowUI>

</ProductKey>

</UserData>

</component>

</settings>

<settings pass="oobeSystem">

<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">

<OOBE>

<HideEULAPage>true</HideEULAPage>

<NetworkLocation>Work</NetworkLocation>

<ProtectYourPC>3</ProtectYourPC>

<SkipMachineOOBE>true</SkipMachineOOBE>

<SkipUserOOBE>true</SkipUserOOBE>

</OOBE>

<TimeZone>Eastern Standard Time</TimeZone>

<UserAccounts>

<AdministratorPassword>

<Value/>

<PlainText>true</PlainText>

</AdministratorPassword>

<LocalAccounts>

</LocalAccounts>

</UserAccounts>

</component>

<component name="Microsoft-Windows-Sidebar" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">

<SidebarOnByDefault>true</SidebarOnByDefault>

<SidebarVisible>true</SidebarVisible>

</component>

<component name="Microsoft-Windows-International-Core" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">

<InputLocale>0409:00000409</InputLocale>

<UserLocale>en-US</UserLocale>

<UILanguage>en-US</UILanguage>

<SystemLocale>en-US</SystemLocale>

</component>

</settings>

<settings pass="specialize">

<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">

<ComputerName></ComputerName>

<RegisteredOrganization>Organization</RegisteredOrganization>

<RegisteredOwner>Organization</RegisteredOwner>

<Display>

<ColorDepth>32</ColorDepth>

<HorizontalResolution>1024</HorizontalResolution>

<RefreshRate>60</RefreshRate>

<VerticalResolution>768</VerticalResolution>

</Display>

</component>

<component name="Microsoft-Windows-SystemRestore-Main" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">

<DisableSR>0</DisableSR>

</component>

<component name="Security-Malware-Windows-Defender" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">

<DisableAntiSpyware>true</DisableAntiSpyware>

</component>

</settings>

<cpi:offlineImage

cpi:source="wim:c:/users/csu/documents/windows%207%20files/sources/install.wim#Windows 7 ENTERPRISE" xmlns:cpi="urn:schemas-microsoft-com:cpi"/>

</unattend>

Link to comment
Share on other sites

Windows could not parse or process the unattend file for pass [specialize]. The settings in the answer file cannot be applied. The error was detected while processing settings for component [Microsoft-Windows-Shell-Setup].
Same results.
Then obviously there were more errors we are not seeing, until we get these errors fixed, we cannot even begin on the other stuff. Have you already installed the WAIK, it comes with a program called WSIM, which will verify your syntax for you. At least we know we can focus on this section (Specialize Pass - [Microsoft-Windows-Shell-Setup])to fix the error
I came up with another unattend file that I found online that sorta works but I have a question. I need to be able to run the setup to add a computer name but I don't want to have to setup a user name since I already created a user account that I want to use when the image was setup.
The way to be prompted for a computer name is to delete this block <ComputerName>NAME-HERE</ComputerName> from whichever XML file you are using. Haven't looked at your second XML very closely, but I do see a computername section set with a blank computername. <ComputerName></ComputerName> Maybe that is the cause of the error, computer name cannot be null value ???

As for the user name thing, I don't see any add user section, so for all we know you will not need to change anything else.

Until all the errors are gone from your XML we will not know if it still prompts to create a user, and until we know if it still prompts to create a user, we cannot decide on if we need to change the XML. Lets focus on getting an XML without errors, then worry about the other stuff.

Here is link to Windows 7 WAIK - WSIM link will be in your Start Menu after installation.

EDIT: Otherwise the error could be you have a setting that cannot be applied during the Specialize Pass - [Microsoft-Windows-Shell-Setup] component. Certain commands can only be run during a particular pass/component pairing. The WSIM will catch these kinds of errors as well.

RE-EDIT: After looking at your other OOBE PASS in the second XML, it is missing it's <Value> beginning block. Anyone else see any errors I missed.

This
<AdministratorPassword>
<Value/>
<PlainText>true</PlainText>
</AdministratorPassword>

Should be - assuming you want a blank unencrypted password.
<AdministratorPassword>
<Value><Value/>
<PlainText>true</PlainText>
</AdministratorPassword>

WSIM also encrypt your passwords for you, it does it automatically. Only way I know how.

Edited by MrJinje
Link to comment
Share on other sites

The first xml was created with WAIK but it will not work so I found a different xml that works but requires me to create a user which I then have to go into the Admin account and delete because I already created all the users when setting up the image. When I use this image on different computers I need to be able to give the computer a name (not setup a user) but every time I run through the setup process I can't figure out a way to only see the computer name option. I did at one point make it not have the computer name but it randomly assigns a name which is no good. Also, when creating the image I've already set the Admin and 1 addition user password.

In XP sysprep was some much easier.

Link to comment
Share on other sites

The first xml was created with WAIK but it will not work so I found a different xml that works but requires me to create a user which I then have to go into the Admin account and delete because I already created all the users when setting up the image. When I use this image on different computers I need to be able to give the computer a name (not setup a user) but every time I run through the setup process I can't figure out a way to only see the computer name option. I did at one point make it not have the computer name but it randomly assigns a name which is no good. Also, when creating the image I've already set the Admin and 1 addition user password.

In XP sysprep was some much easier.

I haven't had a response about this and I'm still stumped as how to only have the option to set a computer name and not have to create a new user.

Link to comment
Share on other sites

I haven't had a response about this and I'm still stumped as how to only have the option to set a computer name and not have to create a new user.
Question, when you install your DVD does it actually complete the installation, or are you still getting errors.

I'm not convinced your autounattend.xml is even working, judging by the previous two, there were many errors that would stop the installation cold. We need to fix those first.

Based on your verbiage I assume you did not remove the <ComputerName> section like instructed. The only way to make it prompt you for a computer name is to remove the <ComputerName> section from whichever XML you are using (edit with notepad if have to).

For the user thing, why not create a dummy account via the XML so you don't get prompted and then delete that account during the setupcomplete.cmd phase so you don't have to worry about it.

EDIT: If you attach (not post as text), you XML I will take a look and check it with WSIM. Not sure if the Quote/Code tags are altering the text somehow.

Edited by MrJinje
Link to comment
Share on other sites

I haven't had a response about this and I'm still stumped as how to only have the option to set a computer name and not have to create a new user.
Question, when you install your DVD does it actually complete the installation, or are you still getting errors.

I'm not convinced your autounattend.xml is even working, judging by the previous two, there were many errors that would stop the installation cold. We need to fix those first.

Based on your verbiage I assume you did not remove the <ComputerName> section like instructed. The only way to make it prompt you for a computer name is to remove the <ComputerName> section from whichever XML you are using (edit with notepad if have to).

For the user thing, why not create a dummy account via the XML so you don't get prompted and then delete that account during the setupcomplete.cmd phase so you don't have to worry about it.

EDIT: If you attach (not post as text), you XML I will take a look and check it with WSIM. Not sure if the Quote/Code tags are altering the text somehow.

Let me explain a little more clearly about what I'm trying to do because maybe I'm being misunderstood.

I have already installed Windows 7 on a PC. I have 2 accounts already setup (Administrator and 1 other user). I don't want to add any more users. All I need to be able to do is run sysprep with an unattended file that will not require me to create a new user but at the same time I do want to be able to give a computer name when I add my (image) to another computer. So, I need the OOBE to run but without requiring me to create a new user account. This is our current process we use with Windows XP.

I've attached my current Unattended file I've been working with.

Autounattended_Test.xml

Link to comment
Share on other sites

Not misunderstand you, just think you are overlooking what I am saying. Let's start over, how are you capturing and applying your image to your second computer. Have you already captured an image and installed on a second computer successfully or not. My guess is not, as your XML file was bork and I could not even open it, see attached for error, had to add the schema information before it could be recognized.

After we get these XML typo's sorted, and you can verify that your image sysprep'd correctly on a second machine, then maybe it is time to worry about the user thing.

Change the first line to from this

<unattend>
to this
<?xml version="1.0" encoding="utf-8"?>

<unattend xmlns="urn:schemas-microsoft-com:unattend">

So back to my first question, have you already captured your sysprep'd image from the first machine and successfully applied it to a second machine yet ?

or are we still in the theory stage and not actually doing any testing ?

It is gonna take trial and error, before you are successful. After we get your sysprep'd WIM captured, we can easily edit it and alter the unattend.xml to address your user issue.

Also, looks to me like you are trying to change your admin password with your XML, if you don't want to do that, maybe you should delete this section.

<AdministratorPassword>

<Value/>

<PlainText>true</PlainText>

</AdministratorPassword>

post-263685-1258556717_thumb.png

Link to comment
Share on other sites

I have successfully syspreped a computer. Once I have the system setup the way I want it, I use BartPE to upload my image to the network. I then use BartPE to pull the image to a different computer successfully. This is the part where I'm running through the OOBE and don't want to see the option to create a new user because in the image there is already the Administrator and 1 other user. All I want/need to do is give the new computer a name without creating a new user.

Also, I've tried creating an image with just the Administrator account and running through OOBE and creating a new user but I end up having to setup everything (programs) in that new user the way I need them to be. This is not the way that will work for me but I just did it as testing.

<AdministratorPassword>

<Value/>

<PlainText>true</PlainText>

</AdministratorPassword>

Is this why when I pull the sysprepped image to another computer it loses the Admin password I already setup?

Also, thank you for help.

Edited by tmcw33
Link to comment
Share on other sites

This is the part where I'm running through the OOBE and don't want to see the option to create a new user because in the image there is already the Administrator and 1 other user. All I want/need to do is give the new computer a name without creating a new user.
I don't think Windows 7 is setup the same way as XP. AFAIK the only way to avoid having to manually create a user during setup, is to create one inside the XML. Then you will need to add a single command on first boot which will automagically delete the account. If someone knows how to do this from inside the XML they have not shared with us.

See post #7 in this thread.

and throw this in your XML User Accounts section.

<UserAccounts>
<LocalAccounts>
<LocalAccount wcm:action="add">
<Password>
<Value></Value>
<PlainText>true</PlainText>
</Password>
<DisplayName>MrJinje</DisplayName>
<Group>Guests</Group>
<Name>MrJinje</Name>
</LocalAccount>
</LocalAccounts>
</UserAccounts>

add this script to Delete the dummy user (AKA that dummy "MrJinje" for example), I am sure you have a script that runs on first boot, add it there.

NET USER MrJinje /DELETE

This allows you to keep your modified user account with custom apps installed and also creates/deletes a MrJinje account to avoid being prompted during install. Anyone else got a better way, we are all ears.

Edited by MrJinje
Link to comment
Share on other sites

This is the part where I'm running through the OOBE and don't want to see the option to create a new user because in the image there is already the Administrator and 1 other user. All I want/need to do is give the new computer a name without creating a new user.
I don't think Windows 7 is setup the same way as XP. AFAIK the only way to avoid having to manually create a user during setup, is to create one inside the XML. Then you will need to add a single command on first boot which will automagically delete the account. If someone knows how to do this from inside the XML they have not shared with us.

See post #7 in this thread.

and throw this in your XML User Accounts section.

<UserAccounts>
<LocalAccounts>
<LocalAccount wcm:action="add">
<Password>
<Value></Value>
<PlainText>true</PlainText>
</Password>
<DisplayName>MrJinje</DisplayName>
<Group>Guests</Group>
<Name>MrJinje</Name>
</LocalAccount>
</LocalAccounts>
</UserAccounts>

add this script to Delete the dummy user (AKA that dummy "MrJinje" for example), I am sure you have a script that runs on first boot, add it there.

NET USER MrJinje /DELETE

This allows you to keep your modified user account with custom apps installed and also creates/deletes a MrJinje account to avoid being prompted during install. Anyone else got a better way, we are all ears.

I haven't tested this yet but wouldn't this bypass the OOBE? I need it to go through OOBE but not require the account creation. There has got to be a way to do this....I hope. Right now my solution is to create the account, login to the Admin account and delete the account I'm required to create. At that point all is well but it sure would be nice to not have to do that.

Link to comment
Share on other sites

I need it to go through OOBE but not require the account creation. There has got to be a way to do this....I hope. Right now my solution is to create the account, login to the Admin account and delete the account I'm required to create.
Read Closer. My example fully automates both creating and deleting the dummy account so you don't have to anything manually. Zero logins required and no OOBE prompt to create user.
I haven't tested this yet but wouldn't this bypass the OOBE?
You said the only prompt in OOBE you wanted to see was the ComputerName prompt, so once you delete the <COMPUTERNAME> section from your XML you will get prompted to enter a ComputerName everytime.

What am I missing. Can someone else explain the exact same thing in different words, my english not so best.

Link to comment
Share on other sites

You said the only prompt in OOBE you wanted to see was the ComputerName prompt, so once you delete the <COMPUTERNAME> section from your XML you will get prompted to enter a ComputerName everytime.

What am I missing. Can someone else explain the exact same thing in different words, my english not so best.

I believe I've tried this before but I'll try it to see if it work....also, is there a way to bypass the limited number of times you can sysprep a machine? I read something about skiprearm but does this really work?

Link to comment
Share on other sites

I believe I've tried this before but I'll try it to see if it work....also, is there a way to bypass the limited number of times you can sysprep a machine? I read something about skiprearm but does this really work?
LOL, don't have to believe me, here is a snip from the Unattend.chm that backs up my story.
ComputerName

ComputerName specifies the computer name used to access the computer from the network.

Values

Computer_name

If ComputerName is missing, you must enter a computer name during Windows® Welcome.

If ComputerName is set to an asterisk (*) or is an empty string, a random computer name will be generated. This random name has at most eight characters from the RegisteredOwner and/or RegisteredOrganization strings plus random characters.

Computer_name is a string with a maximum length of 15 characters.

Never really had issues with too many sysprep, trick for me is to capture the WIM, power off that VM you sysprep'd and only edit the WIM offline. But here is a snip that supposedly resets the Trial state. Instructions say to use it right before you sysprep your machine. But I am not sure this works more than 3 times.
<settings pass="generalize">

<component name="Microsoft-Windows-Security-SPP" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<SkipRearm>0</SkipRearm>

</component>

</settings>

SkipRearmSkipRearm specifies whether to reset the Windows® licensing state when you generalize a computer. You can generalize an installation by using the Sysprep command with the /generalize option, or you can use the Generalize setting.

Resetting the Windows licensing state means that all licensing and registry data related to activation is either removed or reset. The Activation grace-period timer is also reset.

The Activation grace period is typically 30 days. It begins after Windows Setup finishes and the computer boots for the first time. While there is no limit to the number of times that the Sysprep command can run on a computer, there is a limit to the number of times Windows can be rearmed. Typically, a system can be rearmed only three times. Using this setting enables you to run the Sysprep command multiple times without resetting the activation clock.

Important:

Typically while creating a deployment image, you will run the Sysprep command multiple times. To ensure that an installation of an image receives the full Activation grace period: Set the SkipRearm to 1 while customizing your computer. Before running the Sysprep command the final time before deploying an image, rearm the computer by setting the SkipRearm setting to 0. This resets the Activation grace-period timer.

You can review the number of times you can use the SkipRearm setting by running the Slmgr.vbs /dlv command.

Values

0

Specifies that the Windows licensing state will be restored to the original, out-of-box licensing state, and that licensing settings are restored to their defaults.

This is the default value.

1

Specifies that the Windows licensing state will not be changed. The Activation grace-period timer is not reset.

EDIT: On second read, it appears that you should use the setting 1 for testing syspreps, but on your final sysprep before creating your GOLD image, you will want to run the 0 to reset everything. From that it is my understanding that you should only run the 0 setting 3 times. But then again that could be the Whiskey talking, anyone else got a better read on this ?

Edited by MrJinje
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...