Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Question
Monday, February 5, 2018 8:08 PM
I am working on my company's computer image and I need to create a password hash for our answer file. I have scoured the internet to find this answer but, I cannot locate the proper command anywhere. I think there is the possibility of it not existing, or it doesn't not function the way I think it should. Any help would be great! Thank you.
All replies (4)
Monday, February 5, 2018 8:25 PM | 1 vote
The value should generally be created using the unattended setup tool. However, I believe the string is stored as:
ConvertToBase64(<plaintext password>+AdministratorPassword)
For example, if your administrator password is Password1234, you would do this:
$Password = [System.Text.Encoding]::UTF8.GetBytes("Password1234AdministratorPassword")
$PasswordBase64 = [System.Convert]::ToBase64String($Password)
You could then see the result by typing:
$PasswordBase64
Which would show:
UGFzc3dvcmQxMjM0QWRtaW5pc3RyYXRvclBhc3N3b3Jk
To convert a value in a previously saved answer file:
$PasswordToConvert = "UGFzc3dvcmQxMjM0QWRtaW5pc3RyYXRvclBhc3N3b3Jk"
$PlainTextPassword = [System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($PasswordToConvert)).TrimEnd("AdministratorPassword")
Monday, February 5, 2018 8:32 PM | 1 vote
Under <autologon>, you can also flip <Plaintext> to true, and just use a plaintext password in the unattend answer file.
Tuesday, February 6, 2018 2:57 PM
This works perfectly! Thank you!
Wednesday, February 7, 2018 6:14 AM
Please mark the helpful reply as answer in order that other community members could find the helpful reply quickly.
Thanks for your understanding.
Please remember to mark the replies as answers if they help.
If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.