{"id":2546,"date":"2018-07-30T23:54:31","date_gmt":"2018-07-30T23:54:31","guid":{"rendered":"http:\/\/microsoftgeek.com\/?p=2546"},"modified":"2018-07-30T23:58:56","modified_gmt":"2018-07-30T23:58:56","slug":"powershell-admin-tasks-real-time-it-dashboard","status":"publish","type":"post","link":"https:\/\/microsoftgeek.com\/?p=2546","title":{"rendered":"PowerShell Admin Tasks: Real-Time IT Dashboard"},"content":{"rendered":"<p>Creating a real-time IT dashboard is essential for IT professionals for managing their environments and to be proactive.<\/p>\n<p>Every sysadmin should be able to monitor their environment and should send reports or dashboards to the top management on a regular basis. Of course, you can build your own dashboards using a monitoring tool, but you don\u2019t always have a PowerShell module to automate the management of these dashboards. Otherwise, you could also use other projects, for instance, to create a dashboard based on Power BI, but some prerequisites must be validated before using it and, unfortunately, it is not straightforward for beginners.<\/p>\n<p>One of the first things I always think about before using a new product is that there must be a way to control this with PowerShell. This is not a prerequisite, but it could save me a lot of time in the future. Creating a dashboard should be also done using PowerShell to dynamically create a dashboard based on some criteria. For instance, you might want to create a dashboard every morning at 07:00 AM that will list all your machines that are not up and running. Or you might want to create a dashboard that will:<\/p>\n<ul>\n<li>List the top 10 machines for whom the CPU is greater than 90%,<\/li>\n<li>List toner levels for printers<\/li>\n<li>And anything else you can think of\u2026<\/li>\n<\/ul>\n<p>Of course, you can do this with a monitoring tool, but are you able to automate the whole creation process? Wouldn\u2019t it be interesting to be able to launch a simple PowerShell script with several arguments and create a new dashboard on demand? In this case, every admin would be able to create a dashboard even if they don\u2019t have PowerShell skills.<\/p>\n<p>I will try to convince you without further explanation. So please run the following PowerShell commands as an administrator:<\/p>\n<div id=\"crayon-5b5fa36d8fccf411527856\" class=\"crayon-syntax crayon-theme-powershell-output crayon-font-courier-new crayon-os-pc print-yes notranslate\" data-settings=\" minimize scroll-always\">\n<div class=\"crayon-plain-wrap\"><\/div>\n<div class=\"crayon-main\">\n<table class=\"crayon-table\">\n<tbody>\n<tr class=\"crayon-row\">\n<td class=\"crayon-nums \" data-settings=\"hide\"><span style=\"color: #ff00ff;\">\u00a0<\/span><\/td>\n<td class=\"crayon-code\">\n<div class=\"crayon-pre\">\n<div id=\"crayon-5b5fa36d8fccf411527856-1\" class=\"crayon-line\"><span style=\"color: #ff00ff;\"><span class=\"crayon-h\">\u00a0\u00a0<\/span><span class=\"crayon-r \">PS<\/span> <span class=\"crayon-o\">&gt;<\/span> <span class=\"crayon-r \">Install-Module<\/span> <span class=\"crayon-i\">UniversalDashboard<\/span> <span class=\"crayon-cn\">-Force<\/span><\/span><\/div>\n<div id=\"crayon-5b5fa36d8fccf411527856-2\" class=\"crayon-line\"><span style=\"color: #ff00ff;\"><span class=\"crayon-h\">\u00a0\u00a0<\/span><span class=\"crayon-r \">PS<\/span> <span class=\"crayon-o\">&gt;<\/span> <span class=\"crayon-r \">Install-Script<\/span> <span class=\"crayon-cn\">-Name<\/span> <span class=\"crayon-i\">server<\/span><span class=\"crayon-cn\">-performance<\/span><span class=\"crayon-cn\">-dashboard<\/span><\/span><\/div>\n<div id=\"crayon-5b5fa36d8fccf411527856-3\" class=\"crayon-line\"><span style=\"color: #ff00ff;\"><span class=\"crayon-h\">\u00a0\u00a0<\/span><span class=\"crayon-r \">PS<\/span> <span class=\"crayon-o\">&gt;<\/span> <span class=\"crayon-i\">server<\/span><span class=\"crayon-cn\">-performance<\/span><span class=\"crayon-cn\">-dashboard<\/span><span class=\"crayon-sy\">.<\/span><span class=\"crayon-e\">ps1<\/span><\/span><\/div>\n<div id=\"crayon-5b5fa36d8fccf411527856-4\" class=\"crayon-line\"><span style=\"color: #ff00ff;\"><span class=\"crayon-e\">\u00a0\u00a0<\/span><span class=\"crayon-e\">Name\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span class=\"crayon-e\">Port <\/span><span class=\"crayon-i\">Running<\/span><\/span><\/div>\n<div id=\"crayon-5b5fa36d8fccf411527856-5\" class=\"crayon-line\"><span style=\"color: #ff00ff;\"><span class=\"crayon-h\">\u00a0\u00a0<\/span><span class=\"crayon-o\">&#8212;<\/span><span class=\"crayon-o\">&#8212;<\/span><span class=\"crayon-h\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span class=\"crayon-o\">&#8212;<\/span><span class=\"crayon-o\">&#8212;<\/span> <span class=\"crayon-o\">&#8212;<\/span><span class=\"crayon-o\">&#8212;<\/span><span class=\"crayon-o\">&#8212;<\/span><span class=\"crayon-o\">&#8211;<\/span><\/span><\/div>\n<div id=\"crayon-5b5fa36d8fccf411527856-6\" class=\"crayon-line\"><span style=\"color: #ff00ff;\"><span class=\"crayon-h\">\u00a0\u00a0<\/span><span class=\"crayon-i\">Dashboard0<\/span> 10000<span class=\"crayon-h\">\u00a0\u00a0\u00a0\u00a0<\/span><span class=\"crayon-i\">True<\/span><\/span><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>The\u00a0<strong>Install-Script<\/strong>\u00a0cmdlet acquires the script from the\u00a0<a href=\"https:\/\/www.powershellgallery.com\/packages\/server-performance-dashboard\/1.0\/DisplayScript\">PowerShell Gallery<\/a>, verifies that the script is a valid PowerShell script, and copies the script file to the default installation location, which is:\u00a0<em>C:\\Program Files\\WindowsPowerShell\\Scripts.<\/em><\/p>\n<p>Now, open your favorite web browser, and type the following URL:\u00a0<a href=\"http:\/\/localhost:10000\/\"><em>http:\/\/localhost:10000<\/em><\/a>. That\u2019s all; your first PowerShell Dashboard is up and running! Nothing more to do. Below is the output on my Windows 10 laptop:<\/p>\n<p><img decoding=\"async\" class=\"wp-image-78603\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2018\/04\/word-image-246.png\" \/><\/p>\n<p>If you launch this dashboard, you will notice that on the right side of the dashboard, the charts should auto-refresh every 5 seconds. This dashboard has been generated using PowerShell Universal Dashboard.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Creating a real-time IT dashboard is essential for IT professionals for managing their environments and to be proactive. Every sysadmin should be able to monitor their environment and should send reports or dashboards to the top management on a regular basis. Of course, you can build your own dashboards using a monitoring tool, but you [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[59],"tags":[],"class_list":["post-2546","post","type-post","status-publish","format-standard","hentry","category-powershell"],"_links":{"self":[{"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/posts\/2546","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2546"}],"version-history":[{"count":3,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/posts\/2546\/revisions"}],"predecessor-version":[{"id":2549,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/posts\/2546\/revisions\/2549"}],"wp:attachment":[{"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2546"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2546"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2546"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}