5 Replies Latest reply on Jan 27, 2015 10:41 AM by Bill Robinson

    How to delete smart server groups with no matching servers?

    Fernando Castro Guti�rrez de Quevedo

      I'm working on a series of python scripts that populate a server group with child groups following a given hierarchy based on a server extraction from CMDB, with a leaf smart server group which has filters set depeding on the root groups.


      Something like this:




      Here the smart groups would be "Databases", and it would filter servers by "Company contains My_Company1", "Department contains Sales_dept, Environment is Preproduction, Service_name contains Databases" (These are custom properties within BSA)


      Adding new servers works fine, however I'm trying to delete smart groups that no longer have servers that match their rules (For example, no more preproduction servers available in the Sales dept.)


      I was hoping for a blcli along the lines of ServerGroup-CountChildServers or something that allowed me to see if a group (smart or static) is empty, with no child groups and/or servers