Search code examples
c#active-directorywindows-server-2008group-policypassword-policy

How do I set a Group Policy's Password Policy in C#


I am trying to retrieve a group policy from a Windows Server 2008 Active Directory and change the minimum password age, maximum password age, and minimum password length in a C# application.

Is there a way to do this? So far I have only found out how to create new Group Policy objects using Interop.GPMGMTLib (gpmgmt.dll), yet I haven't figured out how to change the policy's password rules and I am not sure if there is an easier way.


Solution

  • I believe that you can use DirectoryEntries of c# to change those Values. this is a gud reference http://www.codeproject.com/Articles/18102/Howto-Almost-Everything-In-Active-Directory-via-C . Also check for msdn references.