Today I got stuck in a strange issue, where the Remove-DisabledMonitoringObject cmdlet apparently stopped to work. It always returned in success but no object (or very few) is removed for the disabled discovery (btw I was fighting with a TMG MP bug, more on this in a later post).
The first step I tried is to invoke the cmdlet with -debug parameter and this was the output
As you can see I confirmed the action and the cmdlet ended in exception. Obviously I checked the ID and it was referring to a now deleted object I used to ask why was still in console (alas I don’t have the time to track every single unexpected behavior).
I then re-executed the cmdlet and this time it finished successfully and objects were indeed removed.
Conclusion: is Remove-DisabledMonitoringObject doesn’t seem to work, just invoke it with the -debug parameter. In my case this fixed the issue.
This posting is provided "AS IS" with no warranties, and confers no rights.