wtsShutdownSystem
Keywords: wtsShutdownSystem
Question:
When using the TermServ extender function "wtsShutdownSystem" with a Flag value of 1, will this function wait until all users are logged off? If it does not wait, do you have any recommendations on how to check if all users have been logged off. My WinBatch program will run a MS Disk Defragmenter and I do not start defrag until all users have been logged off.
Answer:
wtsShutdownSystem actually shuts down a terminal server system. A flag value of 1, will Logoff all user sessions except for the one that called the function. Also, the system console session will never be logged off by this flag value. The terminal server system has logons disabled and they won't be re-enabled until the server is rebooted. This flag value is good for clearing off all users from a server before actually shutting it down.
The function should not return until the process is complete. For testing add a Message statment just after calling wntShutdownsystem. The message will be displayed once the wntshutdownsystem is complete.....
Article ID: W15432
File Created: 2003:05:13:11:27:42
Last Updated: 2003:05:13:11:27:42