Skip to content

Sysprep functions (OSD)

The sysprep category contains functions to create and manipulate settings in the Windows MiniSetup answer files.
These functions work transparently on both sysprep.inf and unattend.xml, giving a uniform way for setting values regardless of operating system version.

UNATTEND FILE OPERATING SYSTEMS FILE LOCATION
Unattend.xml Windows Vista and later, including Windows 10 and 11, and Windows Server 2008 and later, including Windows Server 2025 C:\Windows\Panther\
Sysprep.inf Windows 2000, Windows XP, Windows Server 2003, Windows Server 2003 R2 C:\Sysprep\

The functions use the image’s OS type to choose the file. The drive is the drive the image is deployed to, which is normally C:.

When working with unattend.xml, the unattend.xml file must exist, and the root component tags must exist as shown in the example below. All elements in the components tag will be inserted or deleted by the functions.

The functions use these components:

COMPONENT SETTINGS PASS USED BY
Microsoft-Windows-Deployment specialize Sysprep_AddRunCommand
Microsoft-Windows-UnattendedJoin specialize Sysprep_JoinDomain, Sysprep_JoinWorkgroup
Microsoft-Windows-Shell-Setup specialize Sysprep_SetOrganizationName, Sysprep_SetRegisteredOwner
Microsoft-Windows-Shell-Setup oobeSystem Sysprep_SetLocalAdminPassword
<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
<settings pass="specialize">
<component name="Microsoft-Windows-UnattendedJoin" ...>
</component>
</settings>
</unattend>