Link to home
Start Free TrialLog in
Avatar of talee
talee

asked on

Which value is for the Account Policy in the registry ?

I'm using Windows NT 4.0 and I need to use API to modify  the Account Policy of default option " No Account Lockout" to Account Lockout ".

My question is which registry value is releated to the Account Policy and how can I identify the data that represent the "No Account Lockout" AND" Account Lockout" option.

Ps
To go to Account Policy :
Go to Administrative Tool -> User Manger( On the menu bar select Policies followed by Account )



Avatar of y96andha
y96andha

Go to http://premium.microsoft.com/msdn/library/sdkdoc/f64_54c4.htm

and check out the structure  USER_MODALS_INFO_3
Avatar of talee

ASKER

Sorry, this is not what I want. What I want is to set the "No Account Lockout" option to "Account LockOut" and the " Lockout duration" is set to forever until administrator unlocks the account.The structure USER_MODALS_INFO_3 doesn't allow me to set the Lockout duration to what I want.So I need to know the value for the ACCOUNT POLICY in the registry.
ASKER CERTIFIED SOLUTION
Avatar of y96andha
y96andha

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of talee

ASKER

Sorry, I still not very clear and can't get my program to run.Can you please be more specific and show me an example on how to use the structure.
Thank You.
Here is an example. First the current values are read out, then the new values are set. This turned out to be lots of work for not many points.


                USER_MODALS_INFO_3 *umi3;
                DWORD status;
      status=NetUserModalsGet(L"\\\\ANDREAS",3,(LPBYTE*)&umi3);

      if(!status) {
            wprintf(L"%d %d %d\n",umi3->usrmod3_lockout_duration,
                  umi3->usrmod3_lockout_observation_window,
                  umi3->usrmod3_lockout_threshold);
            NetApiBufferFree((LPBYTE)umi3);
      } else
            wprintf(L"Error: %d",status);
      
      DWORD parmerr;
      DWORD status2;
      USER_MODALS_INFO_3 umi3b;
      umi3b.usrmod3_lockout_duration=TIMEQ_FOREVER;
      umi3b.usrmod3_lockout_observation_window=300;
      umi3b.usrmod3_lockout_threshold=5;
      status2=NetUserModalsSet(L"\\\\ANDREAS",3,(LPBYTE)&umi3b,&parmerr);
      if(status2)
            wprintf(L"Error: %d",status2);