Finding Logged-On User

Share |

Join PowerShell.com!
Subscribe to Feed

PowerShell eBook
Sign up for
Your PowerTip of the Day:

Award-winning PowerShellPlus


Admin Guide to PowerShell Remoting


Mastering PowerShell eBook

There is a helpful console application called quser.exe which will tell you who is logged on to a machine. The executable returns plain text, but with the help of a little regular expression, this text can be converted to CSV and then imported into PowerShell.

So this will give you rich objects for all users currently logged on to your machine:

Twitter This Tip! ReTweet this Tip!


Posted Jan 14 2014, 06:00 AM by ps1

Comments

farisnt wrote re: Finding Logged-On User
on 01-14-2014 11:14 AM

Powershell can not start the application unless I write the full path, that is strange

C:\Windows\WinSxS\amd64_microsoft-windows-t..commandlinetoolsmqq_31bf3856ad364e35_6.3.9600.16384_none_19e7d16c7ffc24f6

Sachin Nair wrote re: Finding Logged-On User
on 01-15-2014 4:47 AM

This is super useful. I always struggled with a way to format the output for commands like quser qwinsta etc. This is so easy. Thanks a ton !

LuckyGuy wrote re: Finding Logged-On User
on 01-15-2014 12:30 PM

@farisnt I noticed the same thing while trying the command from my workstation. However, running it from a server worked fine.Perhaps a server configuration has quser located in a different directory.

Copyright 2012 PowerShell.com. All rights reserved.