User Profile
agoncalves1982
Copper Contributor
Joined 2 years ago
User Widgets
Recent Discussions
Re: Idle time out GPO for Remote Desktop Services sessions not working in Windows 2019 servers
tgellar The only way I was able to log off was with a .bat script and another .ps1 (power shell) .bat file @echo off PowerShell -Command "& {Start-Process PowerShell -ArgumentList '-ExecutionPolicy Bypass -File ""C:\Users\administrator\Documents\Script\Logoff.ps1""' -Verb RunAs}" .ps1 file $sessions = Get-RDUserSession | ? {$_.SessionState -eq "STATE_DISCONNECTED"} foreach($session in $sessions) { Invoke-RDUserLogoff -HostServer $session.HostServer -UnifiedSessionID $session.UnifiedSessionId -Force } After that I created a shedule to call the .bat file which in turn executes the .ps1 file Windows Server 2019 thanks120KViews0likes0Comments
Groups
Recent Blog Articles
No content to show