Check who you are logged in as for PowerShell

Easily check who you are logged in as in PowerShell.

John Savill

March 27, 2017

1 Min Read
Check who you are logged in as for PowerShell

Q. How can I check who I am logged in with in PowerShell?

A. While commands such as whoami work in PowerShell there is a native option:

$me = New-Object Security.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurrent())
$me.Identities.Name

About the Author(s)

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