pete0r Posted December 28, 2010 Posted December 28, 2010 Starting to work on a universal image for my company. We've used msysprep2 for years with our Windows XP image without a single problem. I'd like to use mysysprep2 to automatically rename the PC to the serial number recorded in the BIOS.I'm using mysysprep2 Version 2.0.0.5 for x64 on Windows 7 Pro 64-bit. The executable is placed in c:\windows\system32\sysprep and I execute it by opening up a command prompt and typing "mysysprep.exe /generalize /oobe /shutdown /unattend:c:\setup\unattend.xml". Sysprep will then fail with the message:Windows could not parse or process unattend answer file c::\windows\panther\unattend.xml for pass specialize. The answer file is invalid.This is the step that seems to be causing the problem. If i take out %serialno% and replace it with "*", then sysprep runs correctly.<ComputerName>%SerialNo%</ComputerName>I'm aware that are other solutions which involving running a script after sysprep completes to rename the PC. I'm not sure that's an option for us -- we're a Novell shop and I'd like to have the Novell Zenworks client installed immediately after sysprep completes. The name in zenworks is based upon the PC name, so it needs to be accurate.I suppose my questions are these: Does anyone utilize mysysprep2 to rename their Windows 7 installs? Does anyone know if there is a known problem or issue with using mysysprep2 and Windows 7? Lastly, if I can't use mysysprep2, can someone suggestion some alternative scripts? I'm not the best at scripting but I'll sure give it a try.Here is my unattend.xml file. I also attached as much of the setupact.log file as I could at the bottom of this post. The other log file was empty.<?xml version="1.0" encoding="utf-8"?><unattend xmlns="urn:schemas-microsoft-com:unattend"> <settings pass="generalize"> <component name="Microsoft-Windows-Security-SPP" processorArchitecture="amd64" 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="specialize"> <component name="Microsoft-Windows-Deployment" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <RunSynchronous> <RunSynchronousCommand wcm:action="add"> <Order>1</Order> <Path>net user administrator /active:yes</Path> </RunSynchronousCommand> </RunSynchronous> </component> <component name="Microsoft-Windows-Security-SPP-UX" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <SkipAutoActivation>true</SkipAutoActivation> </component> <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <OEMInformation> <SupportPhone>xxx-xxx-xxx</SupportPhone> <SupportURL>http://website.com</SupportURL> </OEMInformation> <WindowsFeatures> <ShowMediaCenter>false</ShowMediaCenter> <ShowWindowsMediaPlayer>false</ShowWindowsMediaPlayer> </WindowsFeatures> <CopyProfile>true</CopyProfile> <ShowWindowsLive>false</ShowWindowsLive> <TimeZone>Eastern Standard Time</TimeZone> <ComputerName>%SerialNo%</ComputerName> <ProductKey>XXXXX-XXXXX-XXXXX-XXXXX-XXXXX</ProductKey> </component> </settings> <settings pass="oobeSystem"> <component name="Microsoft-Windows-International-Core" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <InputLocale>en-us</InputLocale> <SystemLocale>en-us</SystemLocale> <UILanguage>en-us</UILanguage> <UILanguageFallback>en-us</UILanguageFallback> <UserLocale>en-us</UserLocale> </component> <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <AutoLogon> <Password> <Value>PASSWORD</Value> <PlainText>false</PlainText> </Password> <Enabled>true</Enabled> <LogonCount>3</LogonCount> <Username>administrator</Username> </AutoLogon> <FirstLogonCommands> <SynchronousCommand wcm:action="add"> <Order>1</Order> <CommandLine>cscript //b c:\windows\system32\slmgr.vbs /ipk XXXXX-XXXXX-XXXXX-XXXXX-XXXXX</CommandLine> <RequiresUserInput>false</RequiresUserInput> <Description>Attempt to activate Windows 7 automatically</Description> </SynchronousCommand> </FirstLogonCommands> <OOBE> <HideEULAPage>true</HideEULAPage> <HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE> <NetworkLocation>Work</NetworkLocation> <ProtectYourPC>3</ProtectYourPC> </OOBE> <UserAccounts> <AdministratorPassword> <Value>PASSWORD</Value> <PlainText>false</PlainText> </AdministratorPassword> <LocalAccounts> <LocalAccount wcm:action="add"> <Password> <Value>PASSWORD</Value> <PlainText>false</PlainText> </Password> <Description>Local Administrator</Description> <DisplayName>Administrator</DisplayName> <Group>Administrators</Group> <Name>Administrator</Name> </LocalAccount> </LocalAccounts> </UserAccounts> <RegisteredOrganization>COMPANY</RegisteredOrganization> <RegisteredOwner>COMPANY</RegisteredOwner> <TimeZone>Eastern Standard Time</TimeZone> </component> </settings> <cpi:offlineImage cpi:source="wim:e:/sources/install.wim#Windows 7 PROFESSIONAL" xmlns:cpi="urn:schemas-microsoft-com:cpi" /></unattend>
Tripredacus Posted December 29, 2010 Posted December 29, 2010 You can pull the serial number (or other info) from the BIOS by using WMI Classes. The part you need is probably in W32_Baseboard but I may be wrong. You'll have to do some playing with a system to determine which object you need to pull. I wrote a script in AutoIT that pulls information, I can post this example, but the Serial Number in my example may be for the actual motherboard's serial, not the Serial Number object in the DMI. I have another script somewhere that pulls what you want but I have no idea where that is. You can execute a VBS script at First Logon, but unfortunately this would come after joining the domain via the Unattend.xml.
pete0r Posted January 3, 2011 Author Posted January 3, 2011 You can pull the serial number (or other info) from the BIOS by using WMI Classes. The part you need is probably in W32_Baseboard but I may be wrong. You'll have to do some playing with a system to determine which object you need to pull. I wrote a script in AutoIT that pulls information, I can post this example, but the Serial Number in my example may be for the actual motherboard's serial, not the Serial Number object in the DMI. I have another script somewhere that pulls what you want but I have no idea where that is. You can execute a VBS script at First Logon, but unfortunately this would come after joining the domain via the Unattend.xml.Thanks for the help. I was hoping someone may have some experience with Mysysprep2 before I move onto another solution. It's worked so well for us with Windows XP!
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