Private/ConvertFrom-UserSID.ps1

1
2
3
4
5
6
7
8
9
10
11
function ConvertFrom-UserSID {
    [CmdLetBinding()]
    param([string]$UserSID)
    try {
        $SecurityIdentifier = New-Object System.Security.Principal.SecurityIdentifier($UserSID)
        $SecurityIdentifier.Translate([System.Security.Principal.NTAccount]).Value
    }
    catch {
        $null
    }
}