简体   繁体   English

使用python更改Windows用户密码

[英]Change windows user password with python

I am looking for a way to change the windows password throgh a python script. 我正在寻找一种通过python脚本更改Windows密码的方法。
somthing like a win32api that can help me? 像win32api这样可以帮助我的东西吗?
Thanks! 谢谢!

You can do this with the Win32 function NetUserChangePassword . 您可以使用Win32函数NetUserChangePassword From Python you can access that with win32net.NetUserChangePassword . 从Python中,您可以使用win32net.NetUserChangePassword进行访问。

Although as the documentation points out this won't work if you are using active directory. 尽管正如文档指出的那样,如果您使用的是活动目录,则无法使用。 But in that case you are surely not in a position to change user passwords programmatically. 但是在那种情况下,您肯定不能以编程方式更改用户密码。

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

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