June 26th, 2013

PowerTip: Use a PowerShell command to get User Name and Domain

Doctor Scripto
Scripter

Summary: Use an easy command in Windows PowerShell to get userdomain\username.

Hey, Scripting Guy! Question How can I use a command in Windows PowerShell to get information about a current user in userdomain\username format?

Hey, Scripting Guy! Answer Use the WhoAmI command:

whoami 

Author

The "Scripting Guys" is a historical title passed from scripter to scripter. The current revision has morphed into our good friend Doctor Scripto who has been with us since the very beginning.

0 comments

Discussion are closed.