Created
May 26, 2021 20:39
-
-
Save arnydo/db2032a4b6a8ff62154d44a30352dbe3 to your computer and use it in GitHub Desktop.
Get Friendly Name of a GPO from its GUID
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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