How to set Group Policy password policy in C #

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

Is there any way to do this? So far, I have only learned how to create new GPOs using Interop.GPMGMTLib (gpmgmt.dll), but I have not figured out how to change the rules of the policy rules, and I'm not sure if there is an easier way.

+4
source share
2 answers

I believe that you can use DirectoryEntries C # to change these values. this is a link to gud http://www.codeproject.com/Articles/18102/Howto-Almost-Everything-In-Active-Directory-via-C . Also check links to msdn.

+2
source

I understand this is an old post, but look at the Windows Power Shell cmdlets and Group Policy.

http://technet.microsoft.com/en-us/library/dd759177.aspx

I have not used Power Shell for Group Policy yet, but I often use it to synchronize our payroll system and Exchange server.

+1
source

Source: https://habr.com/ru/post/1310023/


All Articles