Thanks Kevin, I agree with you, I should had word it differently, is not just to delete agents when they become grey but for a decommission process that I'm putting together for our team.
I will also take your suggestion on querying the DB, check last checked in time and also do some other AD, DNS and maybe email the server owner before we delete it. Thanks for the the link, I will take a look. On Tue, Jul 15, 2014 at 2:21 PM, Kevin Holman <[email protected]> wrote: > A grey agent is an agent that has a healthservice that is failing to > heartbeat. I cannot imagine deleting agents simply because they are > unhealthy and need operational review. > > > > If you want to delete agents that have not checked in, in “X” number of > days, you could potentially write a powershell script that deletes agents > who have not checked in in a given amount of time, but if the last state > change is groomed out of the database that might be difficult. You can get > this information from a report/SQL query, such as found in > http://blogs.technet.com/b/kevinholman/archive/2008/06/27/which-servers-are-down-in-my-company-and-which-just-have-a-heartbeat-failure-right-now.aspx. > Theoretically you could script the names into an array and then delete them > based on a date filter. > > > > > > > > > > *From:* [email protected] [mailto: > [email protected]] *On Behalf Of *elsalvoz > *Sent:* Tuesday, July 15, 2014 4:13 PM > *To:* SCOM List > *Subject:* [msmom] Delete grey agents from SCOM 2007/2012 > > > > Hello All, > > > > I'm fairly new to SCOM, I'm looking for way to automate certain task with > powershell or any other methods. > > > > I've been looking for a way to delete grey agents but haven't been able to > find a way to script it. > > > > What's the best automated way to do this task? > > > > Thanks, > > Cesar > > > > [image: Inline image 1] > > > >
