Solved

Which value is for the Account Policy in the registry ?

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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

This article describes how to programmatically preset the "Pages per Sheet" option that's available with most printer drivers.   This setting lets you do "n-Up" printing, where two, four, or more pages are printed on each sheet of paper. If your …
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…
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…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…

628 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