简体   繁体   English

如何以编程方式更改 Active Directory C/C++ 中的用户密码

[英]How to programmatically change user password in Active Directory C/C++

I want to write a small program that uses Domain Administrator credentials to do some operations in Active Directory.我想编写一个使用域管理员凭据在 Active Directory 中执行某些操作的小程序。 One of these operations is to reset the password of domain users.其中一项操作是重置域用户的密码。

I looked on the internet and found some answers (many for C #), but I couldn't find anything that talked about using an administrative credential to leave a domino user password in c/c++.我在互联网上查看并找到了一些答案(许多答案是 C #),但我找不到任何关于使用管理凭据在 c/c++ 中留下多米诺用户密码的内容。

My question is: Is it possible to reset a domain user password using administrative credentials?我的问题是:是否可以使用管理凭据重置域用户密码? If so, how could I do that?如果是这样,我该怎么做?

PowerShell maybe? PowerShell 也许?

Set-ADAccountPassword -Identity $user -Reset -NewPassword (ConvertTo-SecureString -AsPlainText "$newPass" -Force)

Change $user and $newPass.更改 $user 和 $newPass。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM