Quantcast
Channel: Remote Desktop Services (Terminal Services) forum
Viewing all articles
Browse latest Browse all 1106

Logoff users terminal server, powershell?

$
0
0

Hi,

I would like to do the following:

1.Send a message to a remote server that people should logoff
This message should appear every minute till a certain hour, f.e. 5:30 PM

Something like
While($True)
            {
                        msg * /server:servername "This server will go in maintenance . Please logoff.
                        Start-Sleep -s 10
            }


2.Last 5 minutes, server should come in drain mode
Enter server is drain mode
chglogon /drainuntilrestart


3.When it is 5:30 people should be logged off
Something like
Get-TSsession -computername servername -username users | stop-tssession -force

(4.send a message to a user that server is in drainmode)

Please advise.
J.


Jan Hoedt


Viewing all articles
Browse latest Browse all 1106

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>