Friday, September 20, 2013

How to present AD metrics in a SharePoint 2010 dashboard

PowerShell Metrics Series: Active Directory Reporting
How to generate and report basic AD account metrics
How to generate complex AD account metrics part 1
How to generate complex AD account metrics part 2
How to store AD metrics in SharePoint 2010
How to present AD metrics in a SharePoint 2010 dashboard
Introduction

In the previous posting in this series, we explored how to harvest basic Active Directory account metrics, using a PowerShell script running on the server hosting the SharePoint Server 2010 instance, and then writing those metrics to a list in the SharePoint Server 2010 instance.  In this posting, we'll explore methods for presenting those metrics in a SharePoint 2010 dashboard.  We'll explore presenting metrics data using the Data View and Chart web parts.  This will involve the following steps:
  1. Step 1: create a new page
  2. Step 2: customize the page
  3. Step 3: add data view web part and configure
  4. Step 4: add a chart web part and configure.
  5. Step 5: test
Step 1: create page
  1. Open a browser and connect to the site
  2. Navigate to the Site Pages folder
  3. Add a new page to this folder, naming it dashboard.
Step 2: customize page
  1. With the page open for editing, select a Text Layout
  2. Save and close the page.
  3. Launch Designer, and then open the page for editing.
  4. In the bottom most web part zone, insert a Content Editor web part.
  5. Link this web part to a text file containing CSS that hides the Recently Modified group in the Quick Launch navigation section of the page.
  6. Save the page and continue to the next step.
Step 3: add Data View web part
  1. Launch SharePoint Designer 2010, and then connect to the site.
  2. Open dashboard.aspx for editing.
  3. Carefully insert the cursor into a cell, making sure it goes into the DIV container within that cell
  4. On the Insert ribbon, click Data View, and then click Empty Data View.  An empty Data View web part is added and the Data Source Details task view appears.
  5. On the Data Source Details task pane, select the fields to be inserted (these will be the ones displaying integer values), and then select Multiple item View:
  6. In Design view, on the Data View web part, select any column header, and then click the Bold button on the Home
  7. Select the Split view tab to see both design and code simultaneously.
  8. In Code view, edit the column headers
  9. Other possible customizations:
    1. Bold all the column headers.
    2. Set the cell containing the date to NoWrap:
  10. Configure the data view:
    1. Web part title: Total Accounts by Type.
    2. Chrome Type: Title Only.
    3. Chrome State: Normal.
  11. Save the page, and then close the page in Designer.  If this page was checked out, check it back in.
  12. Open a browser and navigate to dashboard.aspx to see the results thus far:
Step 4: add Chart web part
  1. In the browser, check out and open the page for editing.
  2. From the Insert tab, click Web Part; from the Categories pane, select Business Data; and then from the Web Parts pane, select Chart Web Part.
  3. Click Add
  4. On the Chart web part, click Data & Appearance, click Connect Chart to Data, and then select Connect to a List.
  5. Click Next.  From the List dropdown, select the data list
  6. Click Next, and then click Next again.
  7. Configure the Default series as so:
    1. Series Name: Total.
    2. Series Type: Line.
    3. Series X-Axis: Primary.
    4. Series Y-Axis: Primary.
    5. Y Field: TotalAllAccounts.
    6. X Field: Title (or Date, if you added it already).
    7. Leave all others default.
    8. This configures one line of the chart - the line for Total Accounts
  8. Click the "+" icon next to the Series dropdown.
  9. Configure the second series as so:
    1. Series Name: Admin.
    2. Series Type: Line.
    3. Series X-Axis: Primary.
    4. Series Y-Axis: Primary.
    5. Y Field: TotalAdminAccounts.
    6. X Field: Title (or Date, if you added it already).
    7. Leave all others default.
    8. This configures the line for Total Admin Accounts.
  10. Repeat this process for each of the other totals: Service, Test, User.
  11. Click Finish
  12. On the Chart web part, click Advanced Properties.
  13. At left, in the Select an Element link group, click Series.
  14. Above, from the Series Menu dropdown, select Total.
  15. In the list of properties, scroll down to MarkerStyle; click it to open the dropdown and then select a value
  16. Pause for a few seconds to allow the Chart Preview image at right to refresh, before proceeding to make the next change.  Otherwise, any changes will be lost.
  17. Above, from the Series Menu dropdown, select Admin, and repeat.
  18. Repeat these steps for each of the other series (Service, Test, User)
  19. At left, in the Select an Element link group, click Titles.
  20. Click the "+" sign next to the Titles Menu dropdown.
  21. Below, in the list of properties, scroll down to Text (near the bottom), enter a title, and then press Enter
  22. Pause to allow the Chart Preview to refresh.
  23. Change other title properties as desired (e.g., font).
  24. At left, in the Select an Element link group, click Chart Areas.
  25. Above, from the Axis Menu dropdown, select X axis.
  26. Below, scroll down the list of properties to Title (near the bottom), enter text, and then press Enter
  27. Pause to allow the Chart Preview to refresh.
  28. Repeat this for y axis.
  29. Click Finish
  30. Open the page in Designer.
  31. On the Format ribbon, click Chrome Type, and then select None.
  32. Select the Split view.
  33. On the Home ribbon, click Advanced Mode.
  34. Press CTRL+V, enter the search keyword ShowToolbar, and then click Find Next
  35. In Code view, change the ShowToolbar Chart web part property to False.
  36. Close the Find and Replace dialog.
  37. Save the page.
  38. Refresh the browser to see the changes
Step 5: Test
  1. To see the results of several days data capture, enter some sample data into the list, and then refresh the browser
Summary

In this posting of the PowerShell Metrics series, we have explored how to present the Active Directory metrics discussed previously in both list and chart formats.

References
Notes
  • After inserting the Data View onto the page, the specific XML generating each of the headers will not be exposed.  In Split view, if the you select the column header while in the Design view, you will see a group of markup selected in Code view but not specific reference to markup associated with the item selected:

    To expose this XML, use the trick of selecting a header in design view and then bolding it.  This cause Designer to rewrite the XML to specifically script the generation of each header.  Once exposed, you can edit the headers individually as needed
  • SharePoint Server 2010 Standard or Enterprise?  It isn't necessary to expend resources to upgrade SharePoint Server 2010 Standard, as the methods presented here work for either. 
  • SharePoint Server 2010 Chart web part: this web part is based upon the standard .NET chart control.  The SharePoint version has limited documentation, and the vast majority of its properties are not documented per se.  These can, however, be discovered for the most part by reviewing documentation for the .NET chart control.

No comments: