Sunday, October 16, 2016

Policy Plus - Export POL

Today I added an Export POL option to match yesterday's Import POL. For POL-file-based policy sources, the exporter just saves the existing PolFile instance to the new file. To export Registry-based sources, things are a little more interesting. Clearly, exporting the entire Registry would not be acceptable, and looking at every single policy to find the relevant Registry entries would also take a while (and miss some values if there were non-ADMX-based policies involved).

So I took advantage of the list of policy Registry locations I had already compiled. They were used to check whether a policy was really a policy as opposed to a preference. For each policy root, the exporter writes everything under it to a new PolFile, which is then saved to a file.

The changes are live on GitHub.

No comments:

Post a Comment