使用python更改Windows用户密码 [英] Change windows user password with python

查看:176
本文介绍了使用python更改Windows用户密码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一种通过 python 脚本更改 Windows 密码的方法.
诸如 win32api 之类的东西可以帮助我吗?
谢谢!

I am looking for a way to change the windows password throgh a python script.
somthing like a win32api that can help me?
Thanks!

推荐答案

您可以使用 Win32 函数执行此操作 NetUserChangePassword.在 Python 中,您可以使用 win32net.NetUserChangePassword.

You can do this with the Win32 function NetUserChangePassword. From Python you can access that with 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.

这篇关于使用python更改Windows用户密码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆