My Disconnect-LoggedOnUser script is available here: Disconnect-LoggedOnUser

 

This script utilizes quser to query either the local or remote system and parses this into PowerShell objects using the ConvertFrom-Csv Cmdlet. The output generated contains the following columns:

The script can be executed by using the following parameters:

.\Get-LoggedOnUser.ps1 -ComputerName server01

It also supports an array or pipeline input:

.\Get-LoggedOnUser.ps1 -ComputerName server01,server02

'server01','server02' | .\Get-LoggedOnUser.ps1

Version 1.0 - Initial Upload

Version 1.1

Version 1.2

Version 1.2.1

PowerShell
Edit|Remove
<# 
.Synopsis 
Queries a computer to check for interactive sessions 
 
.DESCRIPTION 
This script takes the output from the quser program and parses this to PowerShell objects 
 
.NOTES    
Name: Get-LoggedOnUser 
Author: Jaap Brasser 
Version: 1.2.1 
DateUpdated: 2015-09-23 
 
.LINK 
http://www.jaapbrasser.com 
 
.PARAMETER ComputerName 
The string or array of string for which a query will be executed 
 
.EXAMPLE 
.\Get-LoggedOnUser.ps1 -ComputerName server01,server02 
 
Description: 
Will display the session information on server01 and server02 
 
.EXAMPLE 
'server01','server02' | .\Get-LoggedOnUser.ps1 
 
Description: 
Will display the session information on server01 and server02 
#>