| external help file | DSInternals.PowerShell.dll-Help.xml |
|---|---|
| Module Name | DSInternals |
| online version | https://github.com/MichaelGrafnetter/DSInternals/blob/master/Documentation/PowerShell/ConvertTo-UnicodePassword.md |
| schema | 2.0.0 |
Converts a password to the format used in unattend.xml or *.ldif files.
ConvertTo-UnicodePassword [-Password] <SecureString> [-IsUnattendPassword] [<CommonParameters>]
Converts a password to the Base64-encoded Unicode format that is used in Windows unattend.xml files or LDIF (LDAP Data Interchange Format) files. This format is required when specifying passwords in automated Windows deployment scenarios or when importing user accounts with passwords through LDIF.
PS C:\> $password = Read-Host -AsSecureString -Prompt 'Enter password'
PS C:\> ConvertTo-UnicodePassword -Password $password
<# Sample Output:
UABhAHMAcwB3ADAAcgBkAA==
#>Converts a password to the Base64-encoded Unicode format suitable for use in LDIF files.
PS C:\> $password = Read-Host -AsSecureString -Prompt 'Enter password'
PS C:\> ConvertTo-UnicodePassword -Password $password -IsUnattendPassword
<#
Sample Output:
UABhAHMAcwB3ADAAcgBkAEEAZABtAGkAbgBpAHMAdAByAGEAdABvAHIAUABhAHMAcwB3AG8AcgBkAA==
#>Converts a password to the format used in Windows unattend.xml files, which includes the "AdministratorPassword" suffix.
Indicates that the result should be in the format for unattend.xml instead of *.ldif.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies a password that will be converted to the specified format.
Type: SecureString
Parameter Sets: (All)
Aliases:
Required: True
Position: 0
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThis cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.