none
Answer file (Unattend.xml) is not valid while trying to sysprep RRS feed

  • Question

  • Hello,

    I am trying to create admin user that has "Password never expires" option with Unattend.xml. As I understand this can not be done while Sysprep, but rather on first log on. Therefore I wrote an Unattend.xml which looks like this:

    <?xml version="1.0" encoding="utf-8"?>
    <unattend xmlns="urn:schemas-microsoft-com:unattend">
        <settings pass="oobeSystem">
            <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">
                <OOBE>
                    <HideEULAPage>true</HideEULAPage>
                    <ProtectYourPC>1</ProtectYourPC>
                    <HideLocalAccountScreen>true</HideLocalAccountScreen>
                    <HideOnlineAccountScreens>true</HideOnlineAccountScreens>
                    <HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE>
                </OOBE>
    			<WindowsFeatures>
                    <ShowInternetExplorer>true</ShowInternetExplorer>
    			</WindowsFeatures>	
                <UserAccounts>
                    <LocalAccounts>
                        <LocalAccount wcm:action="add">
                            <DisplayName>wsadmin</DisplayName>
                            <Name>wsadmin</Name>
    			<Password>
    				<Value>BCC.4ws</Value>
    				<PlainText>false</PlainText>
    			</Password>
                            <Group>Administrators</Group>
                        </LocalAccount>
                    </LocalAccounts>
                </UserAccounts>
            </component>
            <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>hr-HR</InputLocale>
                <SystemLocale>hr-HR</SystemLocale>
                <UserLocale>hr-HR</UserLocale>
            </component>
    	<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">
    		</component>
    	</settings>
    	<AutoLogon>
    			<Enabled>true</Enabled>
    			<LogonCount>1</LogonCount>
    			<Username>wsadmin</Username>
    				<Password>
    						<Value>BCC.4ws</Value>
    						<PlainText>false</PlainText>
    				</Password>
    	</AutoLogon>
    	<FirstLogonCommands>
    		<SynchronousCommand wcm:action="add"> 
    				<CommandLine>cmd /C wmic useraccount where "name='wsadmin'" set PasswordExpires=FALSE</CommandLine>
    				<Description>Password never expires wsadmin</Description>
    				<RequiresUserInput>false</RequiresUserInput>
    				<Order>1</Order>
    		</SynchronousCommand>
    	</FirstLogonCommands>
    
    </unattend>
    

    I get error that row with: <SynchronousCommand wcm:action="add"> is not valid. Any ideas?

    Thanks in advance

    Sven
    Sven



    Thursday, November 21, 2019 12:13 PM

Answers

  • If you are not already, please use System Image Manager from the ADK to create the Unattend.xml (answer) file. This will help to avoid, syntax errors.

    The autologon and FirstLogonCommands should be within the <component> tag of "Microsoft-Windows-Shell-Setup". These items look to be outside the component tag after Pass=oobSystem settings.


    Sean Liming - Book Author: Starter Guide Windows 10 IoT Enterprise - www.annabooks.com / www.seanliming.com

    Friday, November 22, 2019 12:58 AM

All replies

  • If you are not already, please use System Image Manager from the ADK to create the Unattend.xml (answer) file. This will help to avoid, syntax errors.

    The autologon and FirstLogonCommands should be within the <component> tag of "Microsoft-Windows-Shell-Setup". These items look to be outside the component tag after Pass=oobSystem settings.


    Sean Liming - Book Author: Starter Guide Windows 10 IoT Enterprise - www.annabooks.com / www.seanliming.com

    Friday, November 22, 2019 12:58 AM
  • Thank you. Will try.
    Tuesday, November 26, 2019 2:40 PM