[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 77
  • Last Modified:

How to retrieve the value for "prompt user to change password before expiration" of local policy settings?

In windows 2000
Goto Start >> Programs >> Administrative tools >> Local Security Settings >> Local Policies >> security options >> "prompt user to change password before expiration"
Mostly the default value of your local policy setting will be 14 days.
The requirement for me is :
I want to query this value programatically through SDK api's for both remote domain server as well as your local machine(precedence is for getting the value from remote domain server ).
0
yogindar
Asked:
yogindar
  • 2
  • 2
1 Solution
 
arbertCommented:
You can get the setting from the registry.

MACHINE/Software/Microsoft/Windows NT/CurrentVersion/Winlogon/PasswordExpiryWarning

Brett
0
 
yogindarAuthor Commented:
Hi Brett
   For local policy it is OK.But what about the remote domain policy.How can I get it?Issue here is if there is a computer in the network with the same name as of the DOMAIN remoteregistry query will return you a value from the network machine right and not from the actual m/c where the DOMAIN exists.
0
 
arbertCommented:
Not sure what you mean--you mean like a RAS or VPN connected computer that isn't actually a member of the domain?
0
 
yogindarAuthor Commented:
Hi Brett
   I mean I can get the value of MACHINE/Software/Microsoft/Windows NT/CurrentVersion/Winlogon/PasswordExpiryWarning using remoteregistry api's.But the issue here is I have a domain named for eg:- DOMAIN1 and I used to login to that domain.But a machine named DOMAIN1 is already existing in the network so If Iam retrieving the value surely it will retrieve the value from DOMAIN1 named machine only not  from the machine where actual DOMAIN1 is,even I dont know the machine name too.So how can I get the machine name.One again my question is is there any api which will retrieve me the machine name if Iam giving it the domain controller name as the input.if Iam getting the machine name I can do a remote registry  query and will retrieve the value.
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now