# get current user $searcher = [ADSISearcher]"(&(objectClass=User)(objectCategory=person)(sAMAccountName=$env:username))" $user = $searcher.FindOne().GetDirectoryEntry() # get binary SID from AD account $binarySID = $user.ObjectSid.Value # convert to string SID $stringSID = (New-Object System.Security.Principal.SecurityIdentifier($binarySID,0)).Value $binarySID $stringSID
Converting Binary SID to String SID

Table of Contents
Table of Contents
Free Trial
Explore all the products and find the right solution for your business.
Latest Content