password history requirements - windows

126 views Asked by At

In windows local group policy, we have the minimum password length, password history requirements etc. So i would like to retrieve the minimum password length and password history requirement programatically using c++

1

There are 1 answers

0
230490 On BEST ANSWER

Found the solution

We can use window's NET_API_STATUS NetUserModalsGet(
  _In_opt_  LPCWSTR servername,
  _In_      DWORD level,
  _Out_     LPBYTE *bufptr
);    API and access the structure _USER_MODALS_INFO_0 to retrieve the minimum length and password history requirement 
ie minlenght =bufptr->usrmod0_min_passwd_len; 
   minhistReq=bufptr->usrmod0_min_passwd_age;