PoshCode Archive  Artifact Content

Artifact d1d3e292042628cc12c1fe33cfbfd07052787252be16d1c7b56b0df9d36238e5:

  • File WellKnownSidType.ps1 — part of check-in [ba487f8238] at 2018-06-10 13:42:56 on branch trunk — See http://msdn.microsoft.com/en-us/library/system.security.principal.wellknownsidtype.aspx (user: greg zakharov size: 606)

# encoding: ascii
# api: powershell
# title: WellKnownSidType
# description: See http://msdn.microsoft.com/en-us/library/system.security.principal.wellknownsidtype.aspx
# version: 0.1
# author: greg zakharov
# license: CC0
# x-poshcode-id: 4559
# x-archived: 2013-11-01T01:03:47
# x-published: 2013-10-26T15:11:00
#
#
[Enum]::GetNames([Security.Principal.WellKnownSidType]) | % {
  $itm = [Security.Principal.WellKnownSidType]::$_
  try {
    $sid = New-Object Security.Principal.SecurityIdentifier($itm, $null)
    $sid.Translate([Security.Principal.NTAccount]).Value
  }
  catch {}
}