powershell - Unregister-Event not removing orphaned event subscriptions -
I am using this to subscribe to events off to a particular computer: it seems Works and I get off the text when the computer is off. The problem is that there is a one-time event and that I subscribed event subscription nothing has been removed to try to use the following to remove.
register -WMIEvent -ComputerName MyServer1 -query "select Win32_ComputerShutdownEvent *" -SourceIdentifier "ShutdownWatcher" action {write-host "MyServer1 has stopped"}
unregistered event -SourceIdentifier "ShutdownWatcher"
Does anyone know how to remove orphan event subscription? One way to stop is Powe's Rshell session but I do not want to actually do that.
subscription with you should be able to clear all out:
Go-Event Subscriber-Force | Unregistered-event-force
Comments
Post a Comment