Sysinternals Freeware - Mark Russinovich & Bryce Cogswell

PsLoggedOn

Copyright © 2000-2006 Mark Russinovich
Last Updated: March 27, 2006 v1.32

Introduction

You can determine who is using resources on your local computer with the "net" command ("net session"), however, there is no built-in way to determine who is using the resources of a remote computer. In addition, NT comes with no tools to see who is logged onto a computer, either locally or remotely. PsLoggedOn is an applet that displays both the locally logged on users and users logged on via resources for either the local computer, or a remote one. If you specify a user name instead of a computer, PsLoggedOn searches the computers in the network neighborhood and tells you if the user is currently logged on. Full source code is included.

PsLoggedOn's definition of a locally logged on user is one that has their profile loaded into the Registry, so PsLoggedOn determines who is logged on by scanning the keys under the HKEY_USERS key. For each key that has a name that is a user SID (security Identifier), PsLoggedOn looks up the corresponding user name and displays it. To determine who is logged onto a computer via resource shares, PsLoggedOn uses the NetSessionEnum API. Note that PsLoggedOn will show you as logged on via resource share to remote computers that you query because a logon is required for PsLoggedOn to access the Registry of a remote system.

Installation

Just copy PsLoggedOn onto your executable path, and type "psloggedon".

PsLoggedOn works on NT 4.0, Win2K, Windows XP and Server 2003.

Usage

usage: psloggedon [-?] [-l] [-x] [\\computername | username]

-?
Displays the supported options and the units of measurement used for output values.
-l
Shows only local logons instead of both local and network resource logons.
-x
Don't show logon times.
\\computername
Specifies the name of the computer for which to list logon information.
username
If you specify a user name PsLoggedOn searches the network for computers to which that user is loggedon. This is useful if you want to ensure that a particular user is not logged on when you are about to change their user profile configuration.

PsTools

PsLoggedOn is part of a growing kit of Sysinternals command-line tools that aid in the adminstration of local and remote Windows NT/2K systems named PsTools.

Download PsLoggedOn (19KB)

Download PsLoggedOn Plus Source (35KB)

Download PsTools

Back to Top