Solved

Which value is for the Account Policy in the registry ?

Posted on 1997-07-09
5
1,124 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
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…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

760 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now