Powershell Grid Widget in SCOM 2012 R2 for Dashboards

I'm finding the powershell widget a bit confusing to use. I'm trying to modify some examples I've found, but am not having much luck. What I would like to do is create a dashboard that has 3 grids, one with server names pulled from a Scom Group, and the other two grids be contexual based on which server is selected, the contextual grids I would like to show me hotfixes installed on the server in the last 7 days, and the other grid to show me server uptime, and last boot time.

Any one have some

April 30th, 2015 11:27am

working on this, I Have a very odd issue, the hotfix is only giving me back one result instead of all the hotfixes it just gives me the first one in the array, this is what the script looks like so far

       

        $inputobject = Get-hotfix -ComputerName SERVERNAME |Where-Object{$_.InstalledOn -eq '4/18/2015 12:00:00 AM'}
       Select-Object Desription, HotFixID, InstalledOn

        foreach ($object in $inputobject)
        {
            $dataObject = $ScriptContext.CreateInstance("xsd://foo!bar/baz")
            $dataObject["Id"] = [String]($object.Message)
                        $dataObject["PSComputerName"] = [String]($object.PSComputerName)
            $dataObject["Description"] = [String]($object.Description)
            $dataObject["HotFixID"] = [String]($object.HotFixID)
            $dataObject["InstallDate"] = [String]($object.InstallDate)
            $dataObject["InstalledOn"] = [String]($object.InstalledOn)
            $ScriptContext.ReturnCollection.Add($dataObject)
        }

Full Disclosure some of this code was bastardized from http://blogs.technet.com/b/stefan_stranger/archive/2014/05/19/powershell-grid-widget-helper.aspx Using Stefan's powershell-grid-widget helper.

Free Windows Admin Tool Kit Click here and download it now
April 30th, 2015 2:56pm

Hi,

Please refer to the link below:

SCOM Script Widgets Sample Dashboards

https://gallery.technet.microsoft.com/SCOM-Script-Widgets-Sample-ef74b7e6

May 26th, 2015 5:28am

thanks Xin, I was able to figure it out.

Free Windows Admin Tool Kit Click here and download it now
May 26th, 2015 8:34am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics