I'm trying to change the password via powershell per this thread: https://forums.starwindsoftware.com/vie ... ord#p28708
The thread states the format of the password:
My understanding of MD5 is that it will always produce a 32 character string and so it can never be as short as what is referenced. My output is always much longer:raw format: "##" + ToBase64(MD5(password))
original: "##evVRsIJtRmAEEd2sCslZDg==" from "starwind"
MD5 hash: 7af551b0826d46600411ddac0ac9590e
New server hash: ##NwBhAGYANQA1ADEAYgAwADgAMgA2AGQANAA2ADYAMAAwADQAMQAxAGQAZABhAGMAMABhAGMAOQA1ADkAMABlAA==
Code: Select all
$password="starwind"
$md5 = new-object -TypeName System.Security.Cryptography.MD5CryptoServiceProvider
$utf8 = new-object -TypeName System.Text.UTF8Encoding
$hash = [System.BitConverter]::ToString($md5.ComputeHash($utf8.GetBytes($password)))
$hash = $hash.ToLower() -replace '-', ''
write-host "MD5 hash: " $hash
$StringBytes = [System.Text.Encoding]::Unicode.GetBytes($hash)
# Encode string content to Base64 string
$newpasswordhash = "##" + [Convert]::ToBase64String($StringBytes)
write-host "New server hash: " $newpasswordhash