PowerShell module for managing Windows Terminal Services (Remote Desktop Services) sessions.
TerminalSessions provides cmdlets to query and manage user sessions on local and remote Windows computers. It uses native Windows APIs to retrieve detailed session information and perform administrative actions.
Install-Module TerminalSessions- Get-TerminalSession - List all sessions on Windows hosts
- Get-TerminalClientInfo - Get detailed client connection information
- Get-TerminalInfo - Get extended session statistics and timing
- Remove-TerminalSession - Log off user sessions
- Disconnect-TerminalSession - Disconnect user sessions
- Send-TerminalMessage - Send Terminal Messages and optionally receive a response
# Get all sessions on the local computer
Get-TerminalSession
# Get sessions from remote computers
Get-TerminalSession -ComputerName "Server01", "Server02"
# Get detailed session information
Get-TerminalSession -Detailed
# Get client connection details
Get-TerminalSession | Get-TerminalClientInfo
# Log off a disconnected session
Get-TerminalSession | Where-Object State -eq Disconnected | Remove-TerminalSessionsee docs folder for more examples
.\build.ps1