PowerShell Remote Desktop Services Monitoring Script
Stale RDS sessions consume licenses and memory. This script inventories all active and disconnected sessions across your RDS farm and optionally logs off orphaned sessions.
Commands Tips
Stale RDS sessions consume licenses and memory. This script inventories all active and disconnected sessions across your RDS farm and optionally logs off orphaned sessions.
Spotting a process that gradually leaks memory or spikes CPU requires time-series data, not a snapshot. This script samples processes at intervals and trends the results over time.
Manually checking Hyper-V VM health in Hyper-V Manager does not scale. This script queries every VM on one or more hosts and builds a color-coded HTML health dashboard.
Instead of polling for changes, WMI event subscriptions let your script react instantly when a process starts, a service stops, or a USB drive is inserted. Here is how to use them.
A service that dies silently can take down critical workloads before anyone notices. This watchdog script monitors a list of services and auto-restarts failures with email
WinRM enables PowerShell remoting across your network. Learn to enable it, configure trusted hosts, set up HTTPS, and troubleshoot connection issues.
Get-WmiObject is deprecated in PowerShell 7. Learn why CIM is the modern replacement, the protocol differences, and how to migrate your WMI scripts.
Invoke-Expression runs string commands dynamically in PowerShell. Learn how to use it safely, its security risks, and when alternatives are better.
Get-NetTCPConnection gives you netstat-style data as objects. Learn to filter active connections by port, state, and process name.
Internal SMTP relays allow PowerShell scripts to send alerts without credentials. Learn to configure anonymous and authenticated SMTP sends.