SID anhand eines Active Directory Benutzernamens
$objUser = New-Object System.Security.Principal.NTAccount("DOMÄNEN-NAME", "BENUTZERNAME")
$strSID = $objUser.Translate([System.Security.Principal.SecurityIdentifier])
$strSID.Value
Benutzernamen anhand einer SID
$objSID = New-Object System.Security.Principal.SecurityIdentifier `
("SID")
$objUser = $objSID.Translate( [System.Security.Principal.NTAccount])
$objUser.Value
SID für einen lokalen Benutzer
$objUser = New-Object System.Security.Principal.NTAccount("LOKALER-BENUTZER")
$strSID = $objUser.Translate([System.Security.Principal.SecurityIdentifier])
$strSID.Value