Is there a way to determine if 开发者_运维百科remote machine is shutting down. May be WMI subsystem sends some events in such cases before it shuts down, so I can subscribe to it?
I've seen sombody here discussing catching EventLog shutting down event, but the author wasn't sure at what point it actually shuts down.
May be WMI subsystem sends some events in such cases before it shuts down, so I can subscribe to it?
Yes, Win32_ComputerShutdownEvent
is what you need.
精彩评论