Get a GPO setting using powershell

1.9k views Asked by At

on a windows 8 machine, I want to read the GPO setting "Accounts: Block Microsoft accounts" which can manually be configured by going here :

Computer Configuration -> Windows Settings -> Security Settings -> Local Policies -> Security Options -> "Accounts: Block Microsoft accounts"

However i want to read the setting using a powershell script

The two options I tried:

  1. Generate the HTML report using Get-GPOReport : the local policies dont come up.
  2. Using gpresult /r : for local group policy it says The following GPOs were not applied because they were filtered out.

can anyone guide me as to how I should proceed. I am extremely new to powershell!

Thanks.

1

There are 1 answers

1
Kostia On

First, you need to generate the GPO report using the Get-GPOReport cmdlet and then parse the XML or HTML report to get the parameter that you need.