Skip to content

Instantly share code, notes, and snippets.

@sebug
Created February 14, 2016 12:40
Show Gist options
  • Save sebug/7fca683a0c352d65547e to your computer and use it in GitHub Desktop.
Save sebug/7fca683a0c352d65547e to your computer and use it in GitHub Desktop.
$AppliedGPOs = $(Get-WmiObject -Namespace 'ROOT\RSOP\Computer' -Class RSOP_GPLink -Filter "AppliedOrder <> 0" | Select @{n='GPO';e={$_.GPO.Replace("RSOP_GPO.","")}} | Select -ExpandProperty GPO)
Get-WmiObject -Namespace 'ROOT\RSOP\Computer' -Class 'RSOP_GPO' -Filter $AppliedGPOs[0]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment