2014-10-31 67 views
3

为什么System.DirectoryServices.AccountManagement.UserPrincipal.SetPassword()不需要System.Security.SecureString作为新密码?是否有另一种方法来更改密码确实使用SecureString使用SecureString设置密码

回答

2

不是所有.NET中的密码处理API都使用SecureString。不知道为什么,因为SecureString级的DirectoryServices.AccountManagement.UserPrincipal早于几个版本。

您可以使用PowerShell cmdlet Set-ADAccountPassword,其确实需要SecureString

+0

感谢您的回答! – 2014-11-11 13:49:00