从密码策略中获取信息
Get information from Password Policy
是否有办法从密码策略中获取一些信息?如密码长度、密码最长使用时间等
我试着在注册表中查找,但没有找到我要找的。
您可以使用NetUserModalsGet
。下面是获取MaximumPasswordAge
int GetMaximumPasswordAge()
{
int Age = -1;
DWORD dwLevel = 0;
USER_MODALS_INFO_0 *pBuf = NULL;
NET_API_STATUS nStatus;
LPTSTR pszServerName = NULL;
//
nStatus = NetUserModalsGet((LPCWSTR) pszServerName,
dwLevel,
(LPBYTE *)&pBuf);
//
// If the call succeeds, print the global information.
//
if (nStatus == NERR_Success)
{
if (pBuf != NULL)
{
Age = pBuf->usrmod0_max_passwd_age/86400;
printf("tMinimum password length: %dn", pBuf->usrmod0_min_passwd_len);
}
}
// Otherwise, print the system error.
//
else
fprintf(stderr, "A system error has occurred: %dn", nStatus);
//
// Free the allocated memory.
//
if (pBuf != NULL)
NetApiBufferFree(pBuf);
return Age;
}
相关文章:
- Visual Studio 2017 C++,不能使用 typeid() 获取信息对象,缺少指针?;
- 如何从 LIBPCAP 获取信息?
- 如何使用 windbg "dt"命令从命名空间污染的内存转储中获取信息
- 从一个案例获取信息到另一个案例
- 我想从文本文件中获取信息并将该信息分配给类对象
- 从Blender获取信息C++(DeviceContext,RenderContext,Scene-Informatio
- 从文本文件c++中获取信息并进行匹配
- CORBA客户端/服务器应用程序,从服务器获取信息(空值)
- 如何解析html并获取信息
- C++套接字 WEB 从特权站点获取信息
- 如何从main到void获取信息
- 从内存进程中获取信息
- 在不遍历文件内容的情况下从文件中获取信息
- 如何在连接到网站时获取信息
- 如何从外部资源中获取信息
- 从EXCEPTION_RECORD中获取信息
- 是否有一种方法可以从VS环境之外的MS单元测试框架中获取信息
- 从标准输出(c++)中获取信息
- 你能像如何从Jar文件中获取信息一样从c++ Lib文件中获取信息吗?
- 如何在c++中从文件中随机获取信息