Tenant Manager Background

Building PowerShell Tools for MSPs: PowerShell Universal Dashboard

Written by Hornetsecurity / 17.08.2018 /
Home » Blog » Building PowerShell Tools for MSPs: PowerShell Universal Dashboard

This is a great time to be in IT! With the rate of emerging projects on GitHub, we are seeing an explosion of projects and a mass collaboration with the community. As an MSP that uses PowerShell to automate its processes, one of the emerging projects worth taking a look at is the PowerShell Universal Dashboard

This is essentially a collection of modules that allows one to create Web GUI Dashboards within a matter of minutes. This is an extremely useful tool and can be heavily utilized with your organization’s 3rd party application APIs to create a unified tool for your MSP.

How to install the PowerShell Universal Dashboard

We need to update PowerShellGet to version 1.6 before we can download and install the Universal Dashboard.To check the verison installed on your server/workstation type:

gcm -module powershellget

If the version listed there is not 1.6 then open up an administrative PowerShell console and type in the following to upgrade:

install-module powershellget -Force

When we run the command again we can see that the module is now upgraded to 1.6:


Building PowerShell Tools for MSPs: PowerShell Universal Dashboard

There are now two editions of the Universal Dashboard. The edition that costs money to run is the ” Enterprise Edition”, which must be licensed or it will only run for 1 hour. To install open up an administrative PowerShell and type in the following command to install the module:

Install-Module -Name UniversalDashboard -RequiredVersion 1.7.0

The 2nd edition available is the Community Edition. This version is free, however there are some features that are not available in this version such as branding of the dashboard and Rest API authentication. To install this version open up an administrative PowerShell console and type in the following:

Install-Module UniversalDashboard.Community -AllowPrerelease

Note: you must have .Net Framework 4.5 installed in order to use PowerShell Get and Run the Universal Dashboard. If you don’t have it installed, get it here.

Getting Started with the PowerShell Universal Dashboard

Once you have the modules installed, you can easily jump into developing your own Dashboard website. The beauty of the Universal Dashboard is that it is built on .net core which means that our dashboards that we create can be run virtual ANYWHERE. We can run them as a container, IIS, as a service on windows, and even right from the command line if we wanted to. To get started, lets create a simple dashboard by typing in the following syntax:

$homepage = New-UDPage -name Homepage -Content {

New-UDCard -Title “This is our Test Card”-Text “I just created this card with the new-udcard cmdlet”

}
$testDashboard = New-UDDashboard -Title “This is our awesome dashboard” -page $homepage

What we did was create a homepage using the New-UDPage cmdlet, we named it Homepage and used the -content parameter to put content into the page itself. In the -Content scriptblock we have the New-UDCard parameter which allows us to create a card on the page and input text into that card.

Next we need to create a dashboard using the New-UDDashboard cmdlet. We use -Title to give our dashboard a title at the top and then specify which pages we want the dashboard to include with the -page parameter and specify our $homepage variable that we saved our homepage as.

Now that we have our dashboard created with pages specified. Next we need to “start” our dashboard. We can do this by adding the Start-UDDashboard cmdlet to the end of our script and specify the $testDashboard dashboard that we created above. I’m also specifying below that port 1000 is used to access this dashboard, which you will see how that works in our next steps below:

Start-UDDashboard -Dashboard $testDashboard -port 1000

Building PowerShell Tools for MSPs: PowerShell Universal Dashboard

Now we can run our entire script either in ISE, PS console, or in my case Visual Studio Code. Then to see the results our our code, we can open up a browser and go to http://localhost:1000. Now we can see the dashboard that we just created:

Building PowerShell Tools for MSPs: PowerShell Universal Dashboard

So in as little as 5 minutes we already have a web hosted GUI running. To stop running this dashboard, we can type in the following command:

get-uddashboard | stop-uddashboard

Going Further With the PowerShell Universal Dashboard

This is just a very basic tutorial on the PowerShell Universal Dashboard intended to show how it works and how quickly you can get a dashboard-styled website up and running.  All we did was make one page that has a card full of text. There are many more cmdlets and features that we can include on our dashboard pages. Check out this site to get an idea, it’s incredible.

The possibilities are limitless with this new framework for quickly creating web GUIs with PowerShell. We could create charts to monitor a specific application or server, or we could even add in authentication to provide privileged access to our dashboards. 

We can also use the Web UI as a front end to run complex PowerShell scripts. Additionally, now that the PowerShell Universal Dashboard has a community edition, we are going to start to see some really cool projects emerge. With PowerShell and application APIs, this tool can be used to create monitoring dashboards of almost anything imaginable. I believe we are just barely scratching the surface with this module.

This post is part of a series about PowerShell tools for MSPs. Why not have a look at the other entries in the series?

Building PowerShell Tools for MSPs: Automating Windows Updates

Building PowerShell Tools for MSPs: HTML Tables for Reporting

Building PowerShell Tools for MSPs: Using SFTP

Building PowerShell Tools for MSPs: Working with REST APIsBuilding PowerShell Tools for MSPs: Advanced Functions