title: How can I manipulate token privileges in .Net?
body: <p>I'd like to use C# to determine which privileges are assigned to my process/thread token, and adjust them as necessary. For example, in order for my program to restart the computer, it must first enable the <code>SeShutdownPrivilege</code> privilege.</p>
  
  <p>How can that be done safely from managed code?</p>