密码策略窗口 API
Password Policy Windows API
是否有任何 API 可以使用本地和/或全局密码策略(读/写策略设置)?
我发现有一个窗口命令:
净账户
它使用什么 API 来读取设置?是否可以在管理员权限下以编程方式更改设置?
User可以使用netapi32.lib中的NetUserModalsGet()函数。
请参阅 https://msdn.microsoft.com/en-us/library/aa370656(VS.85)中的示例.aspx
NetUserModalsGet
struct USER_MODALS_INFO_0
{
DWORD usrmod0_min_passwd_len;
DWORD usrmod0_max_passwd_age;
DWORD usrmod0_min_passwd_age
DWORD usrmod0_force_logoff;
DWORD usrmod0_password_hist_len;
}
PUSER_MODALS_INFO_0 = ^USER_MODALS_INFO_0;
PUSER_MODALS_INFO_0 info0;
NET_API_STATUS res = NetUserModalsGet(nil, 0, out info0);
if (res <> NERR_Success)
RaiseWin32Error(res);
try
//Specifies the minimum allowable password length.
//Valid values for this element are zero through PWLEN.
Log(info0.usrmod0_min_passwd_len);
//Specifies, in seconds, the maximum allowable password age.
//A value of TIMEQ_FOREVER indicates that the password never expires.
//The minimum valid value for this element is ONE_DAY.
//The value specified must be greater than or equal to the value for the usrmod0_min_passwd_age member.
Log(info0.usrmod0_max_passwd_age);
//Specifies the minimum number of seconds that can elapse between the time
//a password changes and when it can be changed again.
//A value of zero indicates that no delay is required between password updates.
//The value specified must be less than or equal to the value for the usrmod0_max_passwd_age member.
Log(info0.usrmod0_min_passwd_age);
//Specifies, in seconds, the amount of time between the end of the valid
// logon time and the time when the user is forced to log off the network.
//A value of TIMEQ_FOREVER indicates that the user is never forced to log off.
//A value of zero indicates that the user will be forced to log off immediately when the valid logon time expires.
Log(info0.usrmod0_force_logoff);
//Specifies the length of password hi'+'story maintained.
//A new password cannot match any of the previous usrmod0_password_hist_len passwords.
//Valid values for this element are zero through DEF_MAX_PWHIST
Log(info0.usrmod0_password_hist_len);
finally
NetApiBufferFree(info0);
end;
你应该看看:
视窗操作系统用户管理
查询新窗口审核策略程序化
相关文章:
- C++win32 API创建多个类似视口的窗口
- 创建进程 API 失败,在窗口 122 上出现错误代码 10
- 更改 ICDBurn 窗口 API 中的默认刻录驱动器
- 无法在窗口中构建 Tensorflow C++ API
- 如何使用Win32 API阻止来自透明窗口的鼠标输入?
- 无法在C++中使用窗口的蓝牙 API 连接到蓝牙设备
- 当用户更改密码时,哪个窗口 API 调用?钩住这个 API 的好方法是什么
- 密码策略窗口 API
- 如何用API窗口拆卸EXE文件
- 如何使用窗口 API 获取其他应用中的当前活动
- 在放大镜窗口上绘制(放大 API)
- Win32 API 检查当前窗口是对话框还是普通窗口
- Win 32 API,使用垂直拆分条绘制两个子窗口
- 您可以在不使用核心音频 API 的情况下更改窗口中音量混合器/sndvol 中列出的程序名称吗?
- 每个窗口的Win32 api类不同
- Win32 API:如何避免基本窗口控件的闪烁
- 使用Richedit控件时,基于对话框的Win32 API程序将不会显示窗口
- 如何在使用Win32 API创建的窗口上添加淡入/淡出效果
- 在windows API上创建子窗口
- Win32 API 窗口无法打开