Skip to content

Instantly share code, notes, and snippets.

@powercode
Created May 16, 2017 20:26
Show Gist options
  • Save powercode/c139df10b04bb10e2d996ff6a95ad8c0 to your computer and use it in GitHub Desktop.
Save powercode/c139df10b04bb10e2d996ff6a95ad8c0 to your computer and use it in GitHub Desktop.
Convert sid to nt account
using namespace System.Security.Principal
function ConvertFrom-SID {
[CmdletBinding()]
[OutputType([NTAccount])]
param([SecurityIdentifier[]] $SID)
$SID.Foreach{$_.Translate([NTAccount])}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment