Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Which value is for the Account Policy in the registry ?

Posted on 1997-07-09
5
Medium Priority
?
1,135 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article shows how to make a Windows 7 gadget that accepts files dropped from the Windows Explorer.  It also illustrates how to give your gadget a non-rectangular shape and how to add some nifty visual effects to text displayed in a your gadget.…
If you have ever found yourself doing a repetitive action with the mouse and keyboard, and if you have even a little programming experience, there is a good chance that you can use a text editor to whip together a sort of macro to automate the proce…
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…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

722 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