< Back
Use-HPEOSPWindowsUnattend
Post
NAME Use-HPEOSPWindowsUnattend
SYNOPSIS
The Use-HPEOSPWindowsUnattend cmdlet creates and applies an unattended answer file to a Windows ISO file.
SYNTAX
Use-HPEOSPWindowsUnattend [-ImageFile] <String> [-ImageIndex] <Int32> [-DiskPartitionMode] <String>
[-InstallToDiskID] <Int32> [-Password] <String> [-OutputFile <String>] [-KeyboardMethod <String>] [-UserLocale
<String>] [-TimeZone <String>] [-ProductKey <String>] [-SetupLanguage <String>] [-ComputerName <String>]
[-MainPartitionLetter <String>] [-MainPartitionLabel <String>] [<CommonParameters>]
DESCRIPTION
The Use-HPEOSPWindowsUnattend cmdlet creates and applies an unattended answer file (autounattend.xml) to a Windows
ISO file. This cmdlet will either create a new ISO file in OutputFile path or overwrite the input ISO file by
deleting the unattended answer file. By default, this overwrites the input ISO file with unattended answer file.
PARAMETERS
-ImageFile <String>
Specifies the Windows ISO file as input. The value must be the Windows local full path.
Required? true
Position? 0
Default value None
Accept pipeline input? True (ByPropertyName, ByValue)
Accept wildcard characters? false
-ImageIndex <Int32>
Specifies the index number of a Windows image to install.
Note:
Use the Get-WindowsImage cmdlet to get information about a Windows image in install.wim file.
Required? true
Position? 1
Default value None
Accept pipeline input? True (ByPropertyName, ByValue)
Accept wildcard characters? false
-DiskPartitionMode <String>
Specifies the partition mode to configure the disk for a Unified Extensible Firmware Interface (UEFI) or
legacy BIOS based server. The disk partition structure will be different for UEFI and legacy BIOS based
server. Possible values are UEFI and LegacyBIOS.
Required? true
Position? 2
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-InstallToDiskID <Int32>
Specifies the identification number of the disk on which to install Windows. This is a relative 0-based index.
Disks are numbered 0, 1, 2, and so on, in the order they are created.
Required? true
Position? 3
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-Password <String>
Specifies the password for a LocalAccount created during installation.
Required? true
Position? 4
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-OutputFile [<String>]
Specifies the output file to create a new Windows ISO with unattended answer file. The value must be Windows
local full path.
Required? false
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-KeyboardMethod [<String>]
Specifies the input language and the keyboard layout for a Windows installation. This setting is used by
Windows Setup and Windows Deployment Services.
Required? false
Position? named
Default value English - United States
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-UserLocale [<String>]
Specifies the language to install that will be used as the default system language to display UI items (such
as menus, dialog boxes, and help files), non-unicode programs, date, time, and currency. This setting is used
by Windows Setup and Windows Deployment Services.
Required? false
Position? named
Default value English - United States
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-TimeZone [<String>]
Specifies the time zone for the server.
Required? false
Position? named
Default value (GMT-08:00) Pacific Time (US and Canada); Tijuana
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-ProductKey [<String>]
Specifies the product key to apply for each unique installation of the Windows operating system. Use this
ProductKey setting to specify the Windows image to install during Windows Setup. This product key specified by
this setting is stored on the computer after installation. If you choose to activate Windows, this product key
will be used. Product keys are 29 characters in the following format:
xxxxx-xxxxx-xxxxx-xxxxx-xxxxx
Required? false
Position? named
Default value
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-SetupLanguage [<String>]
Defines the language to use in Windows Setup and Windows Deployment Services. Possible values are Chinese -
China, Chinese - Taiwan, Czech, Dutch, English, Spanish, French, German, Hungarian, Italian, Japanese, Korean,
Polish, Portuguese - Brazil, Portuguese - Portugal, Russian, Swedish, and Turkish.
Required? false
Position? named
Default value English
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-ComputerName [<String>]
Specifies the computer name used to access the computer from the network. ComputerName is a string with a
maximum length of 15 characters. If you do not specify a value for ComputerName, the value will be empty. If
ComputerName is set to an asterisk (*) or is an empty string, a random computer name will be generated. This
random name has at most eight characters from the RegisteredOwner and/or RegisteredOrganization strings plus
random characters. The default value is empty string.
Required? false
Position? named
Default value *
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-MainPartitionLetter [<String>]
Specifies a drive letter to assign to the partition. Possible values are C through Z.
Required? false
Position? named
Default value C
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-MainPartitionLabel [<String>]
Specifies the name that you apply to a partition. Label is a string with a maximum length of 32 characters.
Required? false
Position? named
Default value Windows
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
System.String
System.Int32
System.Management.Automation.SwitchParameter
OUTPUTS
None
When the cmdlet does not execute correctly, output with the error message is produced. Otherwise, this cmdlet
does not generate any output.
NOTES
???? Not supplying OutputFile overwrites the input ISO file.
???? This cmdlet only supports Windows Server 2012 R2 or Windows Server 2016 ISO.
???? An ISO is created with efisys_noprompt.bin which bypasses the "Press any key to boot from CD or DVD ...."
prompt when booting the installer.
EXAMPLE 1
PS C:\\> Use-HPEOSPWindowsUnattend -ImageFile C:\\TestFolder\\WindowsServer2012R2.iso -ImageIndex 1
-DiskPartitionMode UEFI -InstallToDiskID 0 -Password admin@123
PS C:\\>
This example shows how to overwrite a input ISO with unattended answer file using mandatory parmeters. The default
value will be used for other parameters in unattended answer file.
EXAMPLE 2
PS C:\\> Use-HPEOSPWindowsUnattend -ImageFile C:\\TestFolder\\WindowsServer2016.iso -ImageIndex 4 -DiskPartitionMode
UEFI -InstallToDiskID 0 -Password admin@123 -OutputFile C:\\TestFolder\\NewWindowsServer2016.iso -KeyboardMethod
'English - Australia' -UserLocale 'English - Australia' -TimeZone '(GMT+10:00) Canberra, Melbourne, Sydney'
-ProductKey ABCDE-ABCDE-ABCDE-ABCDE-ABCDE -SetupLanguage English -ComputerName HPETestServer -MainPartitionLetter
E -MainPartitionLabel WindowsOS
PS C:\\>
This example shows how to create a new ISO with unattended answer file in OutputFile location as mentioned.
RELATED LINKS
http://www.hpe.com/servers/powershell
Edit-HPEOSPWindowsUnattend
Get-HPEOSPWindowsUnattendInfo
Remove-HPEOSPWindowsUnattend
SYNOPSIS
The Use-HPEOSPWindowsUnattend cmdlet creates and applies an unattended answer file to a Windows ISO file.
SYNTAX
Use-HPEOSPWindowsUnattend [-ImageFile] <String> [-ImageIndex] <Int32> [-DiskPartitionMode] <String>
[-InstallToDiskID] <Int32> [-Password] <String> [-OutputFile <String>] [-KeyboardMethod <String>] [-UserLocale
<String>] [-TimeZone <String>] [-ProductKey <String>] [-SetupLanguage <String>] [-ComputerName <String>]
[-MainPartitionLetter <String>] [-MainPartitionLabel <String>] [<CommonParameters>]
DESCRIPTION
The Use-HPEOSPWindowsUnattend cmdlet creates and applies an unattended answer file (autounattend.xml) to a Windows
ISO file. This cmdlet will either create a new ISO file in OutputFile path or overwrite the input ISO file by
deleting the unattended answer file. By default, this overwrites the input ISO file with unattended answer file.
PARAMETERS
-ImageFile <String>
Specifies the Windows ISO file as input. The value must be the Windows local full path.
Required? true
Position? 0
Default value None
Accept pipeline input? True (ByPropertyName, ByValue)
Accept wildcard characters? false
-ImageIndex <Int32>
Specifies the index number of a Windows image to install.
Note:
Use the Get-WindowsImage cmdlet to get information about a Windows image in install.wim file.
Required? true
Position? 1
Default value None
Accept pipeline input? True (ByPropertyName, ByValue)
Accept wildcard characters? false
-DiskPartitionMode <String>
Specifies the partition mode to configure the disk for a Unified Extensible Firmware Interface (UEFI) or
legacy BIOS based server. The disk partition structure will be different for UEFI and legacy BIOS based
server. Possible values are UEFI and LegacyBIOS.
Required? true
Position? 2
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-InstallToDiskID <Int32>
Specifies the identification number of the disk on which to install Windows. This is a relative 0-based index.
Disks are numbered 0, 1, 2, and so on, in the order they are created.
Required? true
Position? 3
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-Password <String>
Specifies the password for a LocalAccount created during installation.
Required? true
Position? 4
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-OutputFile [<String>]
Specifies the output file to create a new Windows ISO with unattended answer file. The value must be Windows
local full path.
Required? false
Position? named
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-KeyboardMethod [<String>]
Specifies the input language and the keyboard layout for a Windows installation. This setting is used by
Windows Setup and Windows Deployment Services.
Required? false
Position? named
Default value English - United States
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-UserLocale [<String>]
Specifies the language to install that will be used as the default system language to display UI items (such
as menus, dialog boxes, and help files), non-unicode programs, date, time, and currency. This setting is used
by Windows Setup and Windows Deployment Services.
Required? false
Position? named
Default value English - United States
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-TimeZone [<String>]
Specifies the time zone for the server.
Required? false
Position? named
Default value (GMT-08:00) Pacific Time (US and Canada); Tijuana
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-ProductKey [<String>]
Specifies the product key to apply for each unique installation of the Windows operating system. Use this
ProductKey setting to specify the Windows image to install during Windows Setup. This product key specified by
this setting is stored on the computer after installation. If you choose to activate Windows, this product key
will be used. Product keys are 29 characters in the following format:
xxxxx-xxxxx-xxxxx-xxxxx-xxxxx
Required? false
Position? named
Default value
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-SetupLanguage [<String>]
Defines the language to use in Windows Setup and Windows Deployment Services. Possible values are Chinese -
China, Chinese - Taiwan, Czech, Dutch, English, Spanish, French, German, Hungarian, Italian, Japanese, Korean,
Polish, Portuguese - Brazil, Portuguese - Portugal, Russian, Swedish, and Turkish.
Required? false
Position? named
Default value English
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-ComputerName [<String>]
Specifies the computer name used to access the computer from the network. ComputerName is a string with a
maximum length of 15 characters. If you do not specify a value for ComputerName, the value will be empty. If
ComputerName is set to an asterisk (*) or is an empty string, a random computer name will be generated. This
random name has at most eight characters from the RegisteredOwner and/or RegisteredOrganization strings plus
random characters. The default value is empty string.
Required? false
Position? named
Default value *
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-MainPartitionLetter [<String>]
Specifies a drive letter to assign to the partition. Possible values are C through Z.
Required? false
Position? named
Default value C
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-MainPartitionLabel [<String>]
Specifies the name that you apply to a partition. Label is a string with a maximum length of 32 characters.
Required? false
Position? named
Default value Windows
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
System.String
System.Int32
System.Management.Automation.SwitchParameter
OUTPUTS
None
When the cmdlet does not execute correctly, output with the error message is produced. Otherwise, this cmdlet
does not generate any output.
NOTES
???? Not supplying OutputFile overwrites the input ISO file.
???? This cmdlet only supports Windows Server 2012 R2 or Windows Server 2016 ISO.
???? An ISO is created with efisys_noprompt.bin which bypasses the "Press any key to boot from CD or DVD ...."
prompt when booting the installer.
EXAMPLE 1
PS C:\\> Use-HPEOSPWindowsUnattend -ImageFile C:\\TestFolder\\WindowsServer2012R2.iso -ImageIndex 1
-DiskPartitionMode UEFI -InstallToDiskID 0 -Password admin@123
PS C:\\>
This example shows how to overwrite a input ISO with unattended answer file using mandatory parmeters. The default
value will be used for other parameters in unattended answer file.
EXAMPLE 2
PS C:\\> Use-HPEOSPWindowsUnattend -ImageFile C:\\TestFolder\\WindowsServer2016.iso -ImageIndex 4 -DiskPartitionMode
UEFI -InstallToDiskID 0 -Password admin@123 -OutputFile C:\\TestFolder\\NewWindowsServer2016.iso -KeyboardMethod
'English - Australia' -UserLocale 'English - Australia' -TimeZone '(GMT+10:00) Canberra, Melbourne, Sydney'
-ProductKey ABCDE-ABCDE-ABCDE-ABCDE-ABCDE -SetupLanguage English -ComputerName HPETestServer -MainPartitionLetter
E -MainPartitionLabel WindowsOS
PS C:\\>
This example shows how to create a new ISO with unattended answer file in OutputFile location as mentioned.
RELATED LINKS
http://www.hpe.com/servers/powershell
Edit-HPEOSPWindowsUnattend
Get-HPEOSPWindowsUnattendInfo
Remove-HPEOSPWindowsUnattend