Query Certificate Store for Custom Counter

Has anyone used custom counters to check if an SSL Certificate is <30 days from expiration.  We currently have a job we setup on every sql/web server we have that uses powershell to query the certificate store and compare today to expiration date and if within 30 days email us to let us know to start replacing the cert.  This feels like it would be perfect for a custom counter in spotlight.  But I haven't been able to figure out a WMI query to get the same information.  Anyone else try this?  Any way we can use powershell for custom counters?

Thanks!

Jay

Parents
  • Hi Jason,

    The Custom Counters current design doesn't allow for PS scripts. As for as the WMI query route, because certificate stores are at user level, I doubt WMI can query from that since it's typically used to query the WMI repository for classes and information at instance level.

    If you still want to try the Custom Counters alarms, you can use your existing PS to store the output to a SQL table. Then query against the table by using the Custom Counter SQL query option.

    1.   Create a table in your SQL Server instance

    2.   Add logic to your existing PS to save the related information about expiring certificates in your table

    3.   In Spotlight create a Customer Counter and use a Select statement to query against the table

    You'll find more details about Custom Counters in Video Tutorials page.

    Gita
    Spotlight Support

Reply
  • Hi Jason,

    The Custom Counters current design doesn't allow for PS scripts. As for as the WMI query route, because certificate stores are at user level, I doubt WMI can query from that since it's typically used to query the WMI repository for classes and information at instance level.

    If you still want to try the Custom Counters alarms, you can use your existing PS to store the output to a SQL table. Then query against the table by using the Custom Counter SQL query option.

    1.   Create a table in your SQL Server instance

    2.   Add logic to your existing PS to save the related information about expiring certificates in your table

    3.   In Spotlight create a Customer Counter and use a Select statement to query against the table

    You'll find more details about Custom Counters in Video Tutorials page.

    Gita
    Spotlight Support

Children
No Data