Skip navigation
Q: How can I quickly tell if my PowerShell window is running elevated?

Q: How can I quickly tell if my PowerShell window is running elevated?

A: For some actions to work in Windows PowerShell, your PowerShell session must be running elevated, so it has full administrative rights. If your PowerShell window is running elevated, the word "Administrator:" should be at the start of the title bar. You can also run the command below, which will return true if you are running elevated:

(whoami /all | select-string S-1-16-12288) -ne $null

For example, I entered it and received this response, showing my session is running elevated:

PS C:\Windows\system32> (whoami /all | select-string S-1-16-12288) -ne $null
True

To learn more, see "Top 10 PowerShell Annoyances." You might also be interested in "Top 10 Active Directory Tasks Solved with PowerShell."

Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish