Question

Is there a way to edit the settings from secpol.msc programmatically?

I am looking for something similar to this:

        ManagementScope scope = new ManagementScope("root\\rsop\\user\\" + user.User.Value.Replace('-', '_'));
        ObjectQuery query = new ObjectQuery("Select * from RSOP_PolicySetting");
        ManagementObjectSearcher searcher = new ManagementObjectSearcher(scope, query);

Is root\secpol\... an option?

Was it helpful?

Solution

I found the solution. Reading from the secedit export is perfect: https://gist.github.com/jkingry/421802

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top