Periodically, you might have to shut down specific servers for maintenance or even shut down an entire data center for relocation. Despite efforts to inform users of the shutdown, a few users might still be unaware of the event, so an important last step just before the shutdown is to send users a message about the impending outage. The script ShutdownMessage.bat automates the delivery of such messages.
ShutdownMessage.bat sends a shutdown message to all users who are currently connected to the affected servers. You can customize the message for each server by noting the resources that will be unavailable, when the outage will start, and about how long the outage will last. After you execute the script from a central server or workstation, ShutdownMessage.bat uses the Net Send and Net Session commands, Sysinternals' freeware PsExec utility, and a neat scripting trick to deliver the customized shutdown message.
Net Send and Net Session
The Net Send command uses the Messenger service to deliver messages. You can use this command several ways. You can direct a message to one user or computer. You can direct a message to all the users or computers in the domain or all the users or computers currently logged on to the domain. Finally, you can direct a message to users who are currently accessing resources on the local server. . . .
Why become a VIP member?
 |
VIP-only online access |
 |
VIP CD delivered twice a year: offline access to the entire Windows IT Pro article library |
 |
Monthly issue of your choice of Windows IT Pro or SQL Server Magazine |


Ragid February 20, 2004