Can anyone give me some pointers on how to programmatically access and manipulate group policy?
For example, for a policy such as "Maximum password age" I'd like to be able to query for the setting, be able to tell which group policy object the setting came from, and possibly change the value on that group policy object.
I know (in this case) I can use NetUserModalsGet() to find this out, but it doesn't give any indication about group policy.
The closest I've seen is in the Resultant Set of Policy snap-in (rsop.msc) which displays the policy, the value, and the source GPO. I can't figure out how to do it from the crappy MSDN docs though.
Any pointers to sample code would be greatly appreciated.
Start Free Trial