Created
January 17, 2019 00:39
-
-
Save Trucido/ccb024b7d61fb2a74484c75e8d8f9e32 to your computer and use it in GitHub Desktop.
This file contains 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
param( | |
[Parameter(ValueFromPipeline=$true)] | |
$Sid | |
) | |
if($Sid) | |
{ | |
$securityIdentifier = [System.Security.Principal.SecurityIdentifier] $Sid | |
try | |
{ | |
$ntAccount = $securityIdentifier.Translate([System.Security.Principal.NTAccount]).ToString() | |
} | |
catch{} | |
$ntAccount | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment