Solved

Which value is for the Account Policy in the registry ?

Posted on 1997-07-09
5
1,127 Views
Last Modified: 2013-12-03
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 )



0
Comment
Question by:talee
  • 3
  • 2
5 Comments
 
LVL 5

Expert Comment

by:y96andha
ID: 1400537
Go to http://premium.microsoft.com/msdn/library/sdkdoc/f64_54c4.htm

and check out the structure  USER_MODALS_INFO_3
0
 

Author Comment

by:talee
ID: 1400538
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.
0
 
LVL 5

Accepted Solution

by:
y96andha earned 30 total points
ID: 1400539
You are wrong. You can set the usrmod3_lockout_duration to TIMEQ_FOREVER to make accounts locked out forever until administrator unlocks the account. The registry values are protected; you cannot change them directly.
0
 

Author Comment

by:talee
ID: 1400540
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.
0
 
LVL 5

Expert Comment

by:y96andha
ID: 1400541
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);

0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

As more and more people are shifting to the latest .Net frameworks, the windows presentation framework is gaining importance by the day. Many people are now turning to WPF controls to provide a rich user experience. I have been using WPF controls fo…
What my article will show is if you ever had to do processing to a listbox without being able to just select all the items in it. My software Visual Studio 2008 crystal report v11 My issue was I wanted to add crystal report to a form and show…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question