A few weeks ago I was tasked with babyitting duties on an SCCM environment whilst the regular guy is away. After a few days of logging in and checking site statuses and backups, I decided that it was time to script the task. The challenge of the task being that SCCM 2007 is one of the few products that Microsoft has released lately that doesn't include Powershell integration.
Initially this meant that my script was fairly limited. I was able to check the backup status by hitting the backup directories for each site. If there was a folder named "<<sitecode>>Backup" or "C??Backup". From there I could check the size and gather file modification dates to get the date of the last backup. If the backup failed, there should be a log file in the root of the backup directory which may help diagnosing the cause.
The second part took a bit more digging. After finding out that SCCM reveals quite a bit of information using WMI, I grabbed a really handyPowershell WMI Explorer. Using this tool I was able to fumble my way through finding out the component status for each site server.
Finally, I wrapped all of this in my usual XML/XSL structure to provide customisable reports and the job was done. The result is a functional script, but missing a few "nice to have" features such as:
The script is far from perfect, but did the job for me. Hopefully it is useful for someone out there.
The script can be found here:SCCM Health Status