次の方法で共有


Creating linked reports from favorites.

It’s unfortunate but SCOM 2007 RTM does not have an ability to publish favorite reports back to the reporting server. It can however be done manually. The best way to do this is to create a linked report. Console will show the report even if it is not part of the MP. The recommend way obviously would be to put such reports in a separate folder so they wouldn't be accidently removed by the auto-deployment module (read more about reporting catalog organization at my previous post "SCOM 2007 Report Catalog").

Linked reports are shortcuts to reports with different parameters. Favorite reports are pretty much the same thing. The difference is that linked reports are published to reporting server and could be potentially shared among all SCOM users while favorite reports are very personal things created by the user and used by that user only. Favorite reports are not stored on the reporting server. They are stored in the user settings collection in SCOM operational database instead.

SCOM Command Shell could be used to get a list of favorite reports along with their definitions from the database. Running the following command in the will give you your list of all favorite reports:

$userSettings = (get-item .).ManagementGroup.GetUserSettings()
$userSettings.GetFavoriteMonitoringReports()

To get specific report by name use the following command:

$userSettings = (get-item .).ManagementGroup.GetUserSettings()
$userSettings.GetFavoriteMonitoringReport("<report name>")

Looking at the result you will find that every report contains bunch of fields. The important ones we are looking for are: Name (the one see in the console), list of parameters (ReportParameters) in XML format and MonitoringReportPath which is full part to the original report in the SSRS. The last two pieces are actually all you need to know to create a linked report. All you need to do now is go to SSRS Report Manager, find a report corresponding to MonitoringReportPath, go it its properties, click "Create Linked Report" and carefully paste parameter values for from the ReportParameters XML to the report Parameter section. Easy huh? Actually not. I know. I hope we can do UI for it soon...

After you created a linked report don’t forget to copy the corresponding RPDL file to the same location you put linked report at and five it the same name as the linked report has with .rpdl extension. This will ensure you have nice parameter block for your linked report in the console.

Comments

  • Anonymous
    June 07, 2007
    Shell commands in the article save User Settings object to a $userSettings variable. This is helpful if you like to reuse it multiple times in single shell session. For example: $userSettings = (get-item .).ManagementGroup.GetUserSettings()
    $userSettings.GetFavoriteMonitoringReports()
    $userSettings.GetFavoriteMonitoringReport("<report name 1>")
    $userSettings.GetFavoriteMonitoringReport("<report name 2>")
    You do not have to do that however. If you just need to run a command once you can use the following syntax: (get-item .).ManagementGroup.GetUserSettings().GetFavoriteMonitoringReports()

  • Anonymous
    October 12, 2007
    I forgot to say in the post that since all parameters are returned in one giant XML the values for XML report parameters like “ObjectList” would be encoded and you would need to decode them manually before pasting them to the linked report. Basically you would need to replace all &lt; to < and all &gt; to >. Here is an example.
    Let’s say the result from the script is: <Parameters>
      <Parameter ame="ObjectList">
        <Value>&lt;Data&gt;&lt;Objects&gt;&lt;Object Use="Containment"&gt;9&lt;/Object&gt;&lt;Object Use="Containment"&gt;750&lt;/Object&gt;&lt;/Objects&gt;&lt;/Data&gt;
        </Value>
      </Parameter>
    </Parameters> You need to take the value: &lt;Data&gt;&lt;Objects&gt;&lt;Object Use="Containment"&gt;9&lt;/Object&gt;&lt;Object Use="Containment"&gt;750&lt;/Object&gt;&lt;/Objects&gt;&lt;/Data&gt; and convert it to: <Data><Objects><Object Use="Containment">9</Object><Object Use="Containment">750</Object></Objects></Data>