# Creating dashboards programatically

**URL:** <https://community.squaredup.com/t/creating-dashboards-programatically/64>\
**Category:** Dashboard Server\
**Tags:** automation, dashboards\
**Created:** [February 23, 2016, 11:16am UTC](https://community.squaredup.com/t/creating-dashboards-programatically/64 "2016-02-23T11:16:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dwroberts](https://community.squaredup.com/letter_avatar_proxy/v4/letter/d/e480ec/32.png) [@dwroberts](https://community.squaredup.com/u/dwroberts)\
**Post date:** [February 23, 2016, 11:16am UTC](https://community.squaredup.com/t/creating-dashboards-programatically/64/1 "2016-02-23T11:16:33Z")

</div>

I’ve created a KPI dashboard and I would like to create one for each of our 50+ SharePoint Farms. I know I can clone it, but…that would take quite some time

Does anyone know how to author dashboards programmatically and/or somehow automating the creation of these dashboards? I’m guessing I just need to update the scope in the XML with the SCOM ID of each farm…

Good idea? Bad idea? Guidance

---

<div class="post-metadata">

**Author:** ![thedestroyer100](https://community.squaredup.com/letter_avatar_proxy/v4/letter/t/34f0e0/32.png) [@thedestroyer100](https://community.squaredup.com/u/thedestroyer100)\
**Post date:** [February 23, 2016, 11:18am UTC](https://community.squaredup.com/t/creating-dashboards-programatically/64/2 "2016-02-23T11:18:10Z")

</div>

I managed to achieve a similar thing with PowerShell a few weeks ago. Here’s the script I used to replicate a dashboard that already has the page-level scope set to a SCOM group:

```
# First, load the XML file corresponding to the dashboard
[xml] $xml = get-content C:\inetpub\wwwroot\SquaredUpv2\Configuration\Views\OriginalDashboard.xml

# Replace the page-level scope group ID with 'all windows computers'
$xml.View.Scope.Group = '6f7e3306-beeb-2996-3795-7c1eafb925b8'

# Replace the title 
$xml.View.Title = 'All Windows Computers Dashboard'

# The filename (less the .xml extension) becomes the dashboard ID/url 
$id = "AllWindowsComputersDashboard"

# Now save the new dashboard. Remember to add a .xml file extension
$xml.Save("C:\inetpub\wwwroot\SquaredUpv2\Configuration\Views\$id.xml")

# The new dashboard should then be accessible via: 
# http://localhost/squaredupv2/grid/index/AllWindowsComputersDashboard
```

Hope that helps!

---

<div class="post-metadata">

**Author:** ![koenphilipsen](https://community.squaredup.com/letter_avatar_proxy/v4/letter/k/ecae2f/32.png) [@koenphilipsen](https://community.squaredup.com/u/koenphilipsen)\
**Post date:** [June 17, 2016, 6:56am UTC](https://community.squaredup.com/t/creating-dashboards-programatically/64/3 "2016-06-17T06:56:06Z")

</div>

This is a nice script. But a solution from SquaredUp should be much nicer. Something like a base page with a variable, just lilke the original groups page.
