为用户设置密码,忽略密码策略

发布于 2024-12-03 15:39:09 字数 215 浏览 1 评论 0原文

我正在尝试使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文