XSD schema for autounattend.xml

Microsoft's „Windows System Image Manager“ (WSIM) is used to create autounattend.xml files, and can also validate these files against an XSD schema:

Unfortunately, the XSD schema is not easily accessible, but it can be extracted from WSIM:

Using dotPeek

  1. Install the Windows ADK. You only need the „Deployment Tools“ feature, which includes WSIM.
  2. Run a .NET decompiler such as JetBrains dotPeek and open the file %ProgramFiles(x86)%\Windows Kits\10\Assessment and Deployment Kit\Deployment Tools\WSIM\microsoft.componentstudio.componentplatforminterface.dll.
  3. Navigate to the Microsoft.ComponentStudio.ComponentPlatformInterface.MyResources.resources resource and open it.
  4. Search for unattend to find the Base64 encoded schema:
  5. Select the entire Base64 encoded string (i.e. everything between <value> and </value>), copy it to the clipboard and decode it with PowerShell:
    [System.Text.Encoding]::ASCII.GetString( [System.Convert]::FromBase64String( (Get-Clipboard -Raw) ) ) | Set-Clipboard
  6. Your clipboard now contains the schema:
    <?xml version="1.0" encoding="ASCII"?>
    <xsd:schema targetNamespace="urn:schemas-microsoft-com:unattend" xmlns="urn:schemas-microsoft-com:unattend"
                elementFormDefault="qualified" attributeFormDefault="unqualified">…

Using ildasm.exe

  1. Install the Windows ADK. You only need the „Deployment Tools“ feature, which includes WSIM.
  2. If ildasm.exe is not already installed, download and install the .NET Framework 4.7.2 Developer Pack.
  3. Extract the resources embedded in microsoft.componentstudio.componentplatforminterface.dll:
    c:\>"%ProgramFiles%\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.7.2 Tools\ildasm.exe" "%ProgramFiles(x86)%\Windows Kits\10\Assessment and Deployment Kit\Deployment Tools\WSIM\microsoft.componentstudio.componentplatforminterface.dll" /Output:"%USERPROFILE%\Desktop\Out.il"
  4. Open the file Microsoft.ComponentStudio.ComponentPlatformInterface.MyResources.resources, that was created on your desktop, using a text editor.
  5. Search for <?xml version="1.0" encoding="ASCII"?> to find the schema source code.