PowerShell: End disconnected sessions
The PowerShell script below logs off a disconnected session if the session has been idle for XX minutes, and it also excludes specific users. Additionally, the script writes a log file that includes the memory usage of the session