Im writing a script through powershell and i would like to extract the whole local policies. I understand that secedit will exttract the Account policies only, and the only way to do this is via going to the local security policy and right clicking the 'Local Policy' and clicking the Export List. This enables me to get a file where i can work with. Is there any method to do this via the Command-Line?


You can try using LGPO.EXE tool to extract (as well as import) Local Group Policies, e.g.:

To create a GPO backup from local policy:

LGPO.exe /b path [/n GPO-name]

To parse a Registry.pol file to LGPO text (stdout):

LGPO.exe /parse [/q] {/m|/u} path\registry.pol
  • So there are no way of doing it without a custom software? not even with WMI? Thanks for your help though! will look up on it – Ponilz Apr 13 '16 at 9:00
  • 1
    As the tool was written by a Microsoft employee, I doubt there's a built-in way to achieve this. – Tomas Dabasinskas Apr 13 '16 at 9:13

You can try another app from MS Resource Kit GPO GPInventory. Another way is programmaticaly, using WMI Query and RSOP Class.

Check this Blog for more details How to retrieve currently applied GPOs on your local machine using WMI

  • that looks.. hard, i will probably need to do this though as i am working on a fully automated script sigh – Ponilz Apr 14 '16 at 7:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.