Setting a password using SecureString
Why System.DirectoryServices.AccountManagement.UserPrincipal.SetPassword()
doesn't it accept System.Security.SecureString
for a new password? Is there any other approach to changing the password that is using SecureString
?
SecureString
Unfortunately, not all .NET password processing APIs use . Not sure why as the class is SecureString
preceded by DirectoryServices.AccountManagement.UserPrincipal
multiple versions.
You can use the PowerShell cmdlet Set-ADAccountPassword
that takes SecureString
.