CPI:offlineImage cpi:source question

Page 1 of 2 12 LastLast

  1. Posts : 7
    Windows 7, Windows 10
       #1

    CPI:offlineImage cpi:source question


    I have read quite a few of Kari's posts/articles regarding Windows 10 Unattend files and I am curious why exactly the answer file has to have an offline image 'source' in it. Does this tell setup where the WIM will be at some point, or strictly to link it to a WIM/Catalog to an answer file in Windows SIM?

    If that line is removed, will setup disregard the answer file? I'm curious mostly because the unattend is going to be IN an Sysprep'd image and not 'deployed' or inserted by another tool/service.
      My Computer


  2. Posts : 17,661
    Windows 10 Pro
       #2

    The CPI source is basically only needed when the answer file is edited in Windows System Image Manager. It should be either the install.wim file of the same Windows version, edition and bit architecture than the image we are working with, or a so called catalog file created from such install.wim file.

    It is safe to remove the <cpi> tags (cpi source location and Windows SKU) from an answer file. I have left it intentionally to all answer file samples in my sysprep related tutorials; for the first, it does no harm being there, and for the second in rare occasions it has helped to assist an OP to edit the answer file later on in SIM.

    An example. Here's a simple answer file to relocate the main profile folder Users to drive E:, containing the <cpi> tags:

    Code:
    <?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">
    <FolderLocations>
    <ProfilesDirectory>E:\Users</ProfilesDirectory>
    </FolderLocations>
    </component>
    </settings>
    <cpi:offlineImage cpi:source="wim:X:\sources\install.wim#Windows 10 PRO" xmlns:cpi="urn:schemas-microsoft-com:cpi" />
    </unattend>
    The same answer file with the <cpi> tags removed does exactly the same thing:
    Code:
    <?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">
    <FolderLocations>
    <ProfilesDirectory>E:\Users</ProfilesDirectory>
    </FolderLocations>
    </component>
    </settings>
    </unattend>
    Kari
      My Computer


  3. Posts : 7
    Windows 7, Windows 10
    Thread Starter
       #3

    Now if only WSIM would stop validating, but then producing an error when I hit save.

    Trying to add a local account. When I add it to oobeSystem, put in the name and the password and hit validate -- no issues. When I hit SAVE -- I get a lovely "Unknown setting attribute xmlns:wcm" error.
      My Computer


  4. Posts : 17,661
    Windows 10 Pro
       #4

    Could you post the answer file code (removing all product keys, passwords and such), I'll have a look. Not promising anything but it might be I could find the culprit.
      My Computer


  5. Posts : 7
    Windows 7, Windows 10
    Thread Starter
       #5

    Yes, thank you very much, in advance!

    Code:
    <?xml version="1.0" encoding="utf-8"?><unattend xmlns="urn:schemas-microsoft-com:unattend">
        <settings pass="auditSystem">
            <component name="Microsoft-Windows-PnpCustomizationsNonWinPE" 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">
                <DriverPaths>
                    <PathAndCredentials wcm:keyValue="1" wcm:action="add">
                        <Path>c:\windows\LDDriverStore</Path>
                    </PathAndCredentials>
                </DriverPaths>
            </component>
        </settings>
        <settings pass="auditUser">
            <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>c:\windows\System32\sysprep\sysprep.exe /oobe /generalize /reboot </Path>
                    </RunSynchronousCommand>
                </RunSynchronous>
            </component>
        </settings>
        <settings pass="generalize">
            <component name="Microsoft-Windows-PnpSysprep" 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">
                <PersistAllDeviceInstalls>true</PersistAllDeviceInstalls>
            </component>
        </settings>
        <settings pass="oobeSystem">
            <component name="Microsoft-Windows-Shell-Setup" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" processorArchitecture="AMD64">
                <OOBE>
                    <HideEULAPage>true</HideEULAPage>
                    <ProtectYourPC>1</ProtectYourPC>
                </OOBE>
                <RegisteredOwner>Blah</RegisteredOwner>
                <RegisteredOrganization>Blah</RegisteredOrganization>
                <TimeZone>Central Standard Time</TimeZone>
                <FirstLogonCommands>
                    <SynchronousCommand>
                        <Order>1</Order>
                        <CommandLine>cmd /q /c del /q /f c:\windows\panther\Unattend\unattend.xml</CommandLine>
                    </SynchronousCommand>
                </FirstLogonCommands>
                <UserAccounts>
                    <LocalAccounts>
                        <LocalAccount wcm:action="add" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State">
                            <Password>
                                <Value>blahblah</Value>
                                <PlainText>false</PlainText>
                            </Password>
                            <Name>Blah</Name>
                        </LocalAccount>
                    </LocalAccounts>
                </UserAccounts>
            </component>
        </settings>
        <settings pass="specialize">
            <component name="Microsoft-Windows-Shell-Setup" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" processorArchitecture="AMD64">
                <RegisteredOwner>blah</RegisteredOwner>
                <RegisteredOrganization>blah</RegisteredOrganization>
                <ComputerName>*</ComputerName>
                <CopyProfile>true</CopyProfile>
                <TimeZone>Central Standard Time</TimeZone>
            </component>
            <component name="Microsoft-Windows-UnattendedJoin" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" processorArchitecture="AMD64">
                <Identification>
                    <Credentials>
                        <Domain>blahblah</Domain>
                        <Username>blahblah</Username>
                        <Password>blahblah</Password>
                    </Credentials>
                    <JoinDomain>blahblah</JoinDomain>
                    <MachineObjectOU>blahblah/blah/blah/blah</MachineObjectOU>
                </Identification>
            </component>
        </settings>
        <cpi:offlineImage cpi:source="wim:d:/imaging/windows_10_base/install.wim#Windows 10 Enterprise" xmlns:cpi="urn:schemas-microsoft-com:cpi" />
    </unattend>
    The line is indicated in the error message is this one:
    Code:
    <LocalAccount wcm:action="add" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State">

    Also, I noticed when combing through that I have the time zone twice. Hmm. Oobesystem should be the only place I really need that, right?


    Thanks again!
      My Computer


  6. Posts : 7
    Windows 7, Windows 10
    Thread Starter
       #6

    One thing I just stumbled upon by trial and error -- if I do the 'local account' addition in auditSystem (pass 5) instead of oobeSystem (pass 7), the error message goes away.

    It baffles me why even though settings apply to multiple passes, they only seem to work in very specific situations.


    At any rate, going to test this unattend right quick and see if it does what it SHOULD do!
      My Computer


  7. Posts : 17,661
    Windows 10 Pro
       #7

    lordkaladar said:
    Yes, thank you very much, in advance!
    ...
    ...
    Also, I noticed when combing through that I have the time zone twice. Hmm. Oobesystem should be the only place I really need that, right?
    First, add the local and domain accounts rather in Pass 5 AuditSystem than Pass 7 OobeSystem, like this:

    Code:
    <settings pass="auditSystem">
            <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">
                <UserAccounts>
                    <LocalAccounts>
                        <LocalAccount wcm:action="add">
                            <Description>Main User</Description>
                            <DisplayName>Kari</DisplayName>
                            <Group>Administrators</Group>
                            <Name>Kari</Name>
                        </LocalAccount>
                    </LocalAccounts>
                </UserAccounts>
            </component>
        </settings>
    The same done in SIM. Add component to Pass 5:

    CPI:offlineImage cpi:source question-2015-11-17_16h26_22.png
    (Click to enlarge.)

    Add the user:

    CPI:offlineImage cpi:source question-2015-11-17_16h29_14.png

    About the timezone, add it to Pass 4 Specialize:

    Code:
    <settings pass="specialize">
            <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">
                <TimeZone>W. Europe Standard Time</TimeZone>
            </component>
        </settings>
    The same in SIM:

    CPI:offlineImage cpi:source question-2015-11-17_16h34_11.png

    Should work!

    Kari
      My Computer


  8. Posts : 7
    Windows 7, Windows 10
    Thread Starter
       #8

    It is not making the account. I looked in the setup actions/errors files and there are none, but I'm still prompted to make one and the account name in the answer file is not present anywhere.

    Could having an "sysprep /oobe /generalize /reboot" in AuditUser have anything to do with that?
    (I've never understood why another sysprep is thrown into the process.)
      My Computer


  9. Posts : 17,661
    Windows 10 Pro
       #9

    lordkaladar said:
    It is not making the account. I looked in the setup actions/errors files and there are none, but I'm still prompted to make one and the account name in the answer file is not present anywhere.
    Honestly, I have never had such an issue. The examples in my previous post is how you do it.

    lordkaladar said:
    Could having an "sysprep /oobe /generalize /reboot" in AuditUser have anything to do with that?
    (I've never understood why another sysprep is thrown into the process.)
    I'm totally lost, having not a clue what you mean?

    How you do this:
    • Install Windows on your reference PC
    • When installation is done and OOBE shows the settings dialog, reboot to Audit Mode with CTRL + SHIFT + F3
    • Create your answer file
    • Sysprep with this command:
      Code:
      %windir%\sysprep\sysprep.exe /generalize /oobe /reboot /unattend:X:\AnswerFile.xml
      • The /unattend:AnswerFile_Path switch is not needed if the answer file is saved as unattend.xml in C:\Windows\System32\Sysprep folder
      • If the answer file is saved in any other location or with any other name, the switch /unattend:X:\AnswerFile.xml is needed, telling the path and location of the answer file (in this example AnswerFile.xml on root of the drive X:)
      • The /generalize switch is only needed if the default user profile will be customized or if the image needs to be hardware independent
      • If /generalize switch is used, it should be the first switch after the sysprep command itself

    That's it. User accounts will be created as told in the answer file.
    Last edited by Kari; 17 Nov 2015 at 13:11. Reason: An incredible amount of typos!
      My Computer


  10. Posts : 7
    Windows 7, Windows 10
    Thread Starter
       #10

    I'm going to move the answer file from where it was in our older Windows 7 image into Sys32\Sysprep and see if it behaves.

    I'm basing some of this from the work of a previous admin, sorry. We were using a deployment tool before and performing tons of actions automatically, including the sysprep actions (calling it, capturing the image, etc) but I'm trying to get more hands-on with it as I was not privy to much of the previous image development cycle.

    I appreciate all your help very much! Thank you!

    I'm running the process again.
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 00:57.
Find Us




Windows 10 Forums