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

Is your PowerShell window running with full administrative rights? Here's a handy command to find out.

John Savill

December 29, 2012

1 Min Read
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:Windowssystem32> (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."

About the Author

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like