Variables in Unattend.xml aren't replaced (under certain circumstances).
Hello! I just solved a problem that has been annoying me for two days now. I just wanted to see if someone else can shed some more light on this. It's a long looking post, but basically variables arent replaced in WindowsPE if the Unattend.xml file if defined in a specific manner. I wanted to replace variables for my languagepacks in my Unattend.txt by defining them in a collection. I created an Unattend.txt with System Image Manager and it looked like this: <?xml version="1.0" encoding="utf-8"?> <unattend xmlns="urn:schemas-microsoft-com:unattend"> <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>%OSDInputLocale%</InputLocale> <SystemLocale>%OSDSystemLocale%</SystemLocale> <UserLocale>%OSDUserLocale%</UserLocale> <UILanguage>%OSDUILanguage%</UILanguage> <UILanguageFallback>en-us</UILanguageFallback> </component> </settings> <settings pass="specialize"> <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>%OSDInputLocale%</InputLocale> <SystemLocale>%OSDSystemLocale%</SystemLocale> <UILanguage>%OSDUILanguage%</UILanguage> <UserLocale>%OSDUserLocale%</UserLocale> <UILanguageFallback>en-us</UILanguageFallback> </component> </settings> <settings pass="windowsPE"> <component name="Microsoft-Windows-International-Core-WinPE" 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>%OSDInputLocale%</InputLocale> <SystemLocale>%OSDSystemLocale%</SystemLocale> <UILanguage>%OSDUILanguage%</UILanguage> <UILanguageFallback>en-us</UILanguageFallback> <UserLocale>%OSDUserLocale%</UserLocale> </component> </settings> <cpi:offlineImage cpi:source="wim://stosccm/package$/windows7/windows7-bas.wim#1" xmlns:cpi="urn:schemas-microsoft-com:cpi" /> </unattend> What happend is that only the variables under the entry Specialize get replaced by the variables in my Collection. All the variables below oobeSystem are left as they are. This is the logfile Setupact.log from the Panther-directory on the computer. First Specialize working ok: [windeploy.exe] Found generalization state [0x4], setup.exe completion flag [False] --> launching setup.exe. [windeploy.exe] Launching [C:\Windows\system32\oobe\setup.exe]... [MUIUNATTEND.EXE] Starting MuiUnattend.exe GC [MUIUNATTEND.EXE] muiunattend is called with pass: specialize [MUIUNATTEND.EXE] Found unattend setting "UILanguage" with value: "sv-SE". [MUIUNATTEND.EXE] Found unattend setting "UILanguageFallback" with value: "en-us". [MUIUNATTEND.EXE] Found unattend setting "Systemlocale" with value: "sv-SE". [MUIUNATTEND.EXE] Found unattend setting "UserLocale" with value: "sv-SE". [MUIUNATTEND.EXE] Found unattend setting "InputLocale" with value: "041d:0000041d". [MUIUNATTEND.EXE] Setting UILanguage setting. [MUIUNATTEND.EXE] Setting UILanguage setting to sv-SE succeded. [MUIUNATTEND.EXE] en-us is set as UILanguageFallback. [MUIUNATTEND.EXE] Setting system locale using unattended setting SystemLocale:"sv-SE". [MUIUNATTEND.EXE] Set system locale to "sv-SE" successfully. [MUIUNATTEND.EXE] Setting input locale using unattended setting InputLocale:"041d:0000041d;0409:00000409" [MUIUNATTEND.EXE] Set input locale to "041d:0000041d;0409:00000409" and apply the same setting to default... [MUIUNATTEND.EXE] Setting user locale to using unattended setting UserLocale:"sv-SE", and try apply the... [MUIUNATTEND.EXE] Succeed in setting current user locale to "sv-SE". [MUIUNATTEND.EXE] Succeed in setting location to 221. [MUIUNATTEND.EXE] Succeed in copying settings for current user locale "sv-SE" to default user/system/new user accounts. [MUIUNATTEND.EXE] Set user locale to "sv-SE" successfully and apply the same settings to default user acconts/system And then comes OOBESystem where the variables aren't replaced: [Action Queue] : Executing command "C:\WINDOWS\SYSTEM32\MUIUNATTEND.EXE" oobeSystem [MUIUNATTEND.EXE] Starting MuiUnattend.exe GC [MUIUNATTEND.EXE] muiunattend is called with pass: oobeSystem [MUIUNATTEND.EXE] Found unattend setting "UILanguage" with value: "%OSDUILanguage%". [MUIUNATTEND.EXE] Found unattend setting "UILanguageFallback" with value: "en-us". [MUIUNATTEND.EXE] Found unattend setting "Systemlocale" with value: "%OSDSystemLocale%". [MUIUNATTEND.EXE] Found unattend setting "UserLocale" with value: "%OSDUserLocale%". [MUIUNATTEND.EXE] Found unattend setting "InputLocale" with value: "%OSDInputLocale%". [MUIUNATTEND.EXE] UILanguage is not installed in the system: %OSDUILanguage%. error: 87 [MUIUNATTEND.EXE] Setting system locale using unattended setting SystemLocale:"%OSDSystemLocale%". [MUIUNATTEND.EXE] Failed to set system locale to "%OSDSystemLocale%". [MUIUNATTEND.EXE] Setting input locale using unattended setting InputLocale:"041d:0000041d;0409:00000409" [MUIUNATTEND.EXE] Set input locale to "041d:0000041d;0409:00000409" and apply the same setting to default user ... [MUIUNATTEND.EXE] Setting user locale to using unattended setting UserLocale:"%OSDUserLocale%", and try apply... [MUIUNATTEND.EXE] Failed in setting current user locale to %OSDUserLocale%. Error code is 0x7b [MUIUNATTEND.EXE] Failed to set user locale to "%OSDUserLocale%", or fail to apply the same settings to default user ... [MUIUNATTEND.EXE] Applying user settings to all user (non-system) accounts. [MUIUNATTEND.EXE] Applying settings to user (non-system) accounts succeeded. [MUIUNATTEND.EXE] Setting OOBE handshake information succeeded. [MUIUNATTEND.EXE] Exiting MuiUnattend.exe GC Hence I get the OOBE-miniwizard to choose language at logon. Not so good. I then replaced my Unattend.xml with a very short xml-file with only OOBESystem. Like this: <?xml version="1.0" encoding="utf-8"?> <unattend xmlns="urn:schemas-microsoft-com:unattend"> <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>%OSDInputLocale%</InputLocale> <SystemLocale>%OSDSystemLocale%</SystemLocale> <UILanguage>%OSDUILanguage%</UILanguage> <UILanguageFallback>en-US</UILanguageFallback> <UserLocale>%OSDUserLocale%</UserLocale> </component> </settings> <cpi:offlineImage cpi:source="wim://stosccm/package$/windows7/windows7-bas.wim#1" xmlns:cpi="urn:schemas-microsoft-com:cpi" /> </unattend> And everything works beautifully. What's the problem here? Is "Specialize" forbidden to use in Unattend.xml in SCCM 2007 SP2 (R3), is the file too long, have I overlooked something obvious? Why are the variables not replaced completely in my first unattend.xml ? Thanks and regards, Mathias.
May 13th, 2011 6:00am

why would you want the two others in the first place ?? You only need this pass to set the OS language. settings pass="oobeSystem"> <component name="Microsoft-Windows-International-CoreMichael Petersen http://blog.coretech.dk/mip/
Free Windows Admin Tool Kit Click here and download it now
May 13th, 2011 6:43am

With hindsight it's obvious I do not need the Specialize step to make it work, but to change the keyboard to the correct language settings in Windows PE is useful while troubleshooting.
May 13th, 2011 6:45am

Use this as reference http://scug.be/blogs/sccm/archive/2010/02/02/sccm-windows-7-deployments-amp-unattended-xml.aspx, and if you want to change Winpe keyboard running SCCM, the unattend.xml will not do that, as it is used in the mini setup, after you exit WinPE... To alter language in winpe, open your Boot.wim, and use DISM to change the language, or run "Wpeutil SetKeyboardLayout 0406:00000406" (this is for danish) from within winpe Michael Petersen http://blog.coretech.dk/mip/
Free Windows Admin Tool Kit Click here and download it now
May 13th, 2011 6:50am

Thanks Michael. Could it be that WinPE actually changes language after the first reboot if the " <settings pass="windowsPE">" is available? I'm pretty certain it does... But that aside, your solution is much better since it works from the beginning! The reason I'm asking even though I found the source of my problem is that I've seen a lot of other people discussing on forums why the variables aren't replaced in Unattended.xml (specifically for language settings). It looks to me as if SCCM only does a one-pass replacement of variables?
May 13th, 2011 7:03am

I personally do not use those variables... I use blank entries in my XML, and set the variables using MDT's ZTIConfigure.wsf, which I find is much better as it has error handeling... but you could hold a F8 prompt open during deployment in winpe, and after it is done (before you reboot into OS), go into windows\Panther\unattend\unattend.xml to see what SCCM actually has done to your xml file Michael Petersen http://blog.coretech.dk/mip/
Free Windows Admin Tool Kit Click here and download it now
May 13th, 2011 7:09am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics