Skip to content

AdministratorPassword is encoded incorrectly #48

@HeinziAT

Description

@HeinziAT

Repro (private information redacted):

var options = new AnswerFileOptions()
{
    InstallOptions = new CleanEfiOptions()
    {
        ImageIndex = 2, // Windows Server 2025 Standard (Desktop Experience)
    },
    ProductKey = ...
    EnableRemoteDesktop = true,
    TimeZone = "W. Europe Standard Time",
    ComputerName = ...,
    AdministratorPassword = ...,
    EnableServerManager = false,
};

AnswerFileGenerator.Generate(@"...\autounattend.xml", options);

This will fail with the following error message: "Windows could not complete the installation. To install Windows on this computer, restart the installation". setupact.log shows the cause:

2026-04-22 23:03:32, Warning                      [Shell Unattend] Failed to decode password (0x8007000d) 
2026-04-22 23:03:32, Info                         [Shell Unattend] Exiting 'oobeSystem' pass with status 0x8007000d

The reason for that seems to be that AnswerFileGenerator.cs encodes the administrator password as <password>Password, even though it needs to be encoded as <password>AdministratorPassword.

                Writer.WriteStartElement("AdministratorPassword");
                Writer.WriteElementString("Value", Convert.ToBase64String(Encoding.Unicode.GetBytes(Options.AdministratorPassword + "Password")));

(Unfortunately, I cannot provide a link to an official source explaining that this particular suffix is needed, since the official documentation does not mention the suffix at all. Claude Opus suggested that I replace the base64 encoded <password>Password with <password>AdministratorPassword in the autounattend.xml file, and it fixed the problem for me.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions