快捷方式 - CTRL + ALT + DEL更改密码

时间:2015-10-13 17:26:09

标签: c# windows-authentication

我希望能够将用户引导到Windows内置的Windows CTRL + ALT + DEL更改密码屏幕,但我无法找到实现这一目标的任何线索。 这是我想要使用的东西,而不是通过一个不太安全的方法来创建我自己的Windows窗体。 是否有命令行快捷方式,C#或PowerShell字符串,可以在需要时为用户加载此屏幕?

关于此的说明,

我试图联系saslib @ ms,但电子邮件已经退回。

'网络用户'命令没有帮助,因为我需要这个用于域(AD-DS)用户登录。

非常感谢所有人

Windows 10 Change Password Screen

1 个答案:

答案 0 :(得分:0)

<强>更新

这可以通过Microsoft Windows Software Development Kit中包含的 Sas.dll 中的SendSAS功能来实现。需要在C#中调用此函数。

您还可以构建一个自定义表单,直接在AD中更新用户密码。

using (var context = new PrincipalContext( ContextType.Domain ))
{
  using (var user = UserPrincipal.FindByIdentity( context, IdentityType.SamAccountName, userName ))
  {
      user.SetPassword( "newpassword" );
      // or
      user.ChangePassword( "oldPassword", "newpassword" );
  }
}