title: Converting a binary type SID to System.Security.Principal.SecurityIdentifier in PowerShell
body: <p>I found a link on this website which shows how to convert a SID to the binary type.  Can someone please tell me how to do the reverse - to convert a binary type back to a SID.</p>
  
  <p>This is the script that was provided to go from SID to binary:</p>
  
  <pre><code>PS&gt; $sid = New-Object System.Security.Principal.SecurityIdentifier ("S-1-5-21-105005785-2143699225-541720777-501") 
  PS&gt; $c = New-Object 'byte[]' $sid.BinaryLength 
  PS&gt; $sid.GetBinaryForm($c, 0) 
  </code></pre>
  
  <p>Thanks!</p>