[英]Shortcut - CTRL+ALT+DEL Change Password
I am looking to be able to direct a user to the Windows CTRL+ALT+DEL Change Password screen as built into Windows but I have not been able to find any lead into making this happen. 我希望能够将用户定向到Windows内置的Windows CTRL + ALT + DEL更改密码屏幕,但是我无法找到导致这种情况的任何线索。 This is something that I want to use instead of going via a less secure method of creating my own Windows form for this. 这是我要使用的东西,而不是通过一种不太安全的方法为此创建自己的Windows窗体的方法。 Is there a command line shortcut, C# or PowerShell string that can load this screen for a user when required? 是否有命令行快捷方式,C#或PowerShell字符串可以在需要时为用户加载此屏幕?
Notes about this, 关于此的注意事项
I have tried to contact saslib@ms but email have bounced. 我试图与saslib @ ms联系,但电子邮件已退回。
The 'net user' command does not help as I need this for domain (AD-DS) user logons. “网络用户”命令无济于事,因为我需要域(AD-DS)用户登录。
Many thanks all 非常感谢大家
Update 更新资料
This can be achieved through the SendSAS function in Sas.dll included in the Microsoft Windows Software Development Kit . 这可以通过SendSAS功能Sas.dll包含在实现Microsoft Windows软件开发工具包 。 This function needs to be invoked in C#. 此函数需要在C#中调用。
You could also build a custom form which updates the users password directly in the AD. 您还可以构建一个自定义表单,该表单可以直接在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" );
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.