r/PowerShell • u/PorreKaj • Jan 19 '19
Universal Dashboard Sample
I posted yesterday about a Dashboard displaying information on our company's consultants. and a few guys/guyettes asked if I could share the code.Well, not exactly, but i managed to built something similar, without the company specifics.
https://github.com/PorreKaj/UD-Sample/
Simply install UniversalDashboard.Community 2.2.1 (requires .net 4.7.2), download the script and run it (well, don't just run stuff from the internet tho).It pulls data from AD so the ActiveDirectory module needs to be installed too.
note: To stop the dashboard, use Get-UDDashboard | Stop-UDDashboard
Once running, you can visit http://localhost:10001/ and see a dashboard with 3 pages.
(If that port is used, you can change the port number on the last line of the script.)
# Page 1 AD Dashboard, simple counters, donut chart, and a search box that's a bit more on the advanced side, search result will have a button that open a popup (modal) and show a bit more information on the account.(The search box is almost a direct copy of the one available on Ud marketplace - https://marketplace.universaldashboard.io/Dashboard/ud-activedirectory)

# Consultant dashboard.So this view is a bit more fun, but it relies on consultants being members of a group (in our case named "Consultants"), the name of the group can be changed on line 21 in the script.

# ServersSomeone out there asked if this could be used to monitor server metrics.Of course!, if you can get to the data with powershell, you can display it.
in this case, the docs specifically show how to do this - https://docs.universaldashboard.io/components/monitors
CPU and Memory monitors will be displayed for localhost, and for 2 servers you'll have to define in line 6 and 7.I didn't have time to do anything fancy, so these monitors only show data while the page is running, refresh and they'll start all over.

I tried to keep the code behind "segmented and neat" but it gets messy fast, and I ran out of time for today.
let me know how it goes.
Edit: forgot a block of code for the 'Employees by department' chart - ISE remembered the data for the chart so it never showed.
3
u/joshvilla36 Jan 21 '19
I agree it’s definitely an information overload at first. If I knew more of the Splunk dev side I would ask to implement this into a Splunk app... Regardless great job man!
2
u/PorreKaj Jan 21 '19
Thanks! I think I’ll make something for SCCM next, maybe then I’ll be comfortable enough to take on a beast like Splunk.
2
u/PorreKaj Jan 20 '19
Once you’ve gotten the hang of it,the marketplace has a sample of some more stuff that can be done with UD
https://marketplace.universaldashboard.io/Dashboard/ud-activedirectory
I recommend visiting the forums as well for any questions or issues - http://forums.universaldashboard.io The developers are very active and great at answering questions, even my lame ones :-)
2
u/tumblatum Jan 20 '19
since it pulls data from AD, then all the user specific info needs to be populated in AD initially, is that right? Like how to you define user's department?
2
u/PorreKaj Jan 20 '19
The Organization tab in active directory users and computers have a “Department” field. :-)
2
u/PorreKaj Jan 20 '19
But yes data needs to be populated, we had the same issue, identifying consultant, and getting the Office location right requires a bit of work. But the good thing is, with this you can practically give HR access to easily see the accounts and find wrong info.
2
u/AscendingEagle Jan 20 '19
Very grateful for the script. Anyone else having a problem installing UD? Every time I try I face the error that a file couldn't be accessed because a process is using it. Each time a different file.
3
u/PorreKaj Jan 20 '19
Doing it from ISE? I’ve seen that causing issues.
You might also want to update the PowershellGet module.
2
u/AscendingEagle Jan 20 '19
Nah from powershell.exe
I'll try updating the module and report back. Thanks.
3
u/PorreKaj Jan 20 '19
Had so much trouble updating powershellget on my pc that I had to copy the module from another machine. Ironic!
5
1
u/joshvilla36 Jan 21 '19
This is awesome! Have you ever thought about integrating it with Splunk or Kibana?
1
u/PorreKaj Jan 21 '19
Can’t wrap my head around splunk. Give me instant headache:D
1
u/joshvilla36 Jan 21 '19
I agree it’s definitely an information overload at first. If I knew more of the Splunk dev side I would ask to implement this into a Splunk app... Regardless great job man!
1
3
u/Zeniaz Jan 19 '19
So I'm trying to change Distribution of Employees by Department to By Office field instead. How would I go about doing that? I tried changing the "Department" fields to "Office" it doesn't seem to work.