Skip to content

Instantly share code, notes, and snippets.

@arnydo
Created May 26, 2021 20:39
Show Gist options
  • Save arnydo/db2032a4b6a8ff62154d44a30352dbe3 to your computer and use it in GitHub Desktop.
Save arnydo/db2032a4b6a8ff62154d44a30352dbe3 to your computer and use it in GitHub Desktop.
Get Friendly Name of a GPO from its GUID
function Get-GPOName {
[Cmdletbinding()]
param (
[Parameter(Mandatory)]
[string]$GUID
)
$CN = ‘CN={0}’ -f $GUID
(New-Object DirectoryServices.DirectorySearcher -Property @{Filter = $CN }).FindOne().properties.displayname
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment