使用SecureString设置密码

5
为什么 System.DirectoryServices.AccountManagement.UserPrincipal.SetPassword() 不接受 System.Security.SecureString 作为新密码?有没有其他方式来改变密码并且使用SecureString呢?
1个回答

4

不幸的是,.NET中并非所有密码处理API都使用SecureString。不确定为什么,因为SecureString类比DirectoryServices.AccountManagement.UserPrincipal更早发布。

您可以使用PowerShell cmdletSet-ADAccountPassword,它确实需要SecureString


谢谢你的回答! - rory.ap

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接