为用户设置密码,忽略密码策略
我正在尝试使用 NetUserSetInfo 以编程方式设置特定用户(本地帐户,而不是域)的密码。然而,在某些情况下,它会给我错误 2245 (NERR_PasswordTooShort
) 或其他与策略相关的错误。
在这种特定情况下,我希望程序(以管理员权限运行)能够设置密码,即使它违反了正常的桌面密码策略(它是一个特殊帐户)。如何让 Windows 忽略这一操作的策略?
I'm trying to programmatically set the password of a specific user (local account, not domain), using NetUserSetInfo
. However in some cases it is giving me error 2245 (NERR_PasswordTooShort
) or other policy-related errors.
In this specific case I want the program (running with admin permissions) to be able to set the password even if it is violation of the normal desktop password policy (it's a special account). How do I get Windows to ignore the policy for this one operation?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论