Windows Server 2019 – System Insights

After a small hiatus on Twitter, I got back just in time to notice a Tweet about the following [sorry, was unable to find who created the original Tweet, but saved the link luckily]:

Getting started with System Insights in 10 minutes

This fit in perfectly with my recent post on the Windows Admin Center, and I’ve got 10 minutes to spare, so let’s go!

Installing System Insights

As you can imagine, this is simply a breeze

Where is it?

Ok, I’ve installed the Admin Center and enabled System Insights, but I still don’t see the option.

For me this was the case, even after closing my browser and reconnecting.

Once you’re in the Admin Center, go to the Settings gear icon in the top right and choose Extensions [under Gateway]

Select the Windows Server System Insights (Preview) extension and Install it

Using System Insights

Once installed, you will see System Insights added to the Tools section of the server that has it installed.

It comes predefined with 4 settings it will check up on:

  • CPU capacity forecasting
  • Network capacity forecasting
  • Total storage consumption forecasting
  • Volume consumption forecasting

You can simply select one and click on Invoke to actually generate the data required for the forecast.

Unfortunately, if you run this on a fairly new machine [<2 hours], there’s a big chance you’ll run into this ‘notification’

Be sure to check out the videos on what kind of data you can expect if you’re impatient

Isn’t this a PowerShell related blog?

Well, yes, mainly it is 🙂

So it turns out, you can full access all this data through your friendly neighbourhood automation swiss knife!

It’s good to see that the terminology used in the Windows Admin Center mimics the cmdlets used in PowerShell, so it’s easy to reproduce what you’re trying to accomplish.

will simply show you all of the currently available forecasts, while

will start the process.

Do note generating analytics can be a process intensive operation, so PowerShell will actually warn you about this

Also interesting to keep in mind that Invoking capabilities though the Windows Admin Center will generate a notification in the Notification area, doing so through PowerShell will NOT.

Here’s what I love

Now while this is all nice and dandy, my favourite option can be found under the Settings -> Actions option for each Capability:

You can link Actions in the form of PowerShell scripts to be performed depending on the returned prediction status.

For example:

On the Volume consumption forecasting capability, you can  have an Action set on Warning that the system should try to clear out log files in a certain directory, or perhaps clear the C:\Windows\SoftwareDistribution\Download folder to quickly clear up some hard needed space.

Just imagine all the posibilities!

I want analytics, but I don’t want my to share my data

Now just in case you’re into tinfoil hats and are a little paranoid, you might wonder “where do they get all the data from to provide me with these analytics?”

Apparently it’s all local based analytics, so no sending data to evil cloud providers or Cambridge Analytica 😉 .
And even better, it’s fully operational through PowerShell, what more can I ask for?

 

Well, this might have been a little over 10 minutes, but I hope it’s been worth your while!

Play around with it, see what kind of cool things you can make and be sure to share them!

Happy Scripting! 🙂

Facebooktwitterredditlinkedinmail

Windows Server 2019 – Windows Admin Center

After having played around a bit with Windows 2019 server, it was time to see what this “Project Honolulu” was all about.
Only to find out it’s no longer called that, it’s now been re-branded to it’s [hopefully] final name: Windows Admin Center

What IS the Windows Admin Center?

Well, according to Microsoft it’s simply this:

Windows Admin Center is a new, locally-deployed, browser-based management tool set that lets you manage your Windows Servers with no Azure or cloud dependency. Windows Admin Center gives you full control over all aspects of your server infrastructure and is particularly useful for managing servers on private networks that are not connected to the Internet.

Windows Admin Center is the modern evolution of “in-box” management tools, like Server Manager and MMC. It complements System Center – it’s not a replacement.

The quick definition for me would be a better version of the Server Manager, now accessible through your browser!

But enough talk, let’s take it for a spin!

Let’s prepare the prerequisites

Off we go, downloading the latest LTSC build for Windows Server 2019 [you will need that version if you want Desktop Experience] and while we’re at it, I’ll grab a copy of the new Windows Admin Center  🙂

Spinning up my test lab machine [Intel NUC6i5SYH in case you’re interested], I immediately create a new 2019 VM to see what’s what.

Literally 3 minutes after clicking on the install button I was looking at my logon screen 🙂

This is going to be a good night!

New toy time! Windows Admin Center

Ok, so we have our server up and running, let’s install the Windows Admin Center and see what we can do!

First we’ll need to copy the installation file from our lab to our VM:

Presto Chango, files are copied on to the VM [if you didn’t know about this before, you might want to look up something called PowerShell Direct]

I’m using all the defaults to install the Windows Admin Center, using default ports and a self signed certificate [usable for 60 days].
Of course in production you’d want to look into securing this, but this is still preview and test-lab, so knock yourself out 🙂

Ehm… what’s this?

Once Windows Admin Center’s installed, you want to start using it to see all the cool toys…
You open the browser and enter the URL https://<servername> , only to be greeted with the following error:

Turns out, you’re supposed to manage your severs from a management machine [preferably Windows 10 of course] and not on your server.
Since this is a quick test lab however, I’ll just install a decent browser and get along with the show!

Do note that due to the self signed SSL certificate, you will still get an error message, it’s just safe to proceed

 

Phew, that’s better!

After all those errors, it’s time to actually start up what we came here for [well, part of it]

You’ll first be greeted by the Tour window, but the contents are currently rather shabby

After that’s closed, you get to the actual heart of the Admin Center

Select the machine you want to manage and click Connect.
This will prompt you for the machine’s credentials [first time only] and will give you access to all the sexy tools it has to offer…

Now we’re talking!

Honorable mentions

Now I won’t go through ALL the features the Admin Center has to offer [although I’m really tempted], but I’ll throw in some features I thought were just AWESOME to be able to manage centrally:

  • Firewall settings
  • Network settings
  • PowerShell
  • RDP
  • Registry
  • Updates

They all just work IN THE BROWSER!!

Start playing around to see how it works, how FAST it actually is and be amazed at how user friendly it all is!

Have fun!

Facebooktwitterredditlinkedinmail

Using Pester for Infrastructure testing

Recently the company I am working at was running into performance issues which became a pain to sort out as it was so sporadic [lasted like 5 mins max every time], but when it happened it affected the entire company.
I was asked to assist in troubleshooting and finding out exactly what was causing this within the short time frame available.

Narrowing down troubleshooting

First we had to look into what kind of issues we ran into and we quickly had a suspicion that this was caused by our Anti-Virus software throwing fits.
But how to prove this…

Seeing that we run a VMWare based shop with Citrix VDIs and mostly Windows Servers , PowerShell is of course my go-to tool.
However, firstly I’ll try and see if I can find things in for instance performance graphs/metrics during the aforementioned  time frames when people reported the issues.

This narrowed it down for us to the following questions:

  • Front end: what’s the performance of our AV scan servers for VDIs [we use host based scanning instead of agents on our clients]?
  • Front end: what’s the performance of our VMWare hosts for the VDIs?
  • Back end: what’s the performance of our AV scan servers for Servers?
  • Back end: what’s the performance of our VMWare hosts for the Servers?
  • Back end: what’s the performance of our Citrix farm’s VMs?
  • Back end: what’s the performance of our RES [now IVANTI] infrastructure VMs?

We had been able to exclude our storage system, which for me was fine as the PowerShell integration for our storage is subpar at the moment.

Can I get the information I need?

Playing around with PowerShell, I quickly noticed that all information needed was obtainable, albeit through various cmdlets.

Instead I created 2 functions that are able to get all the required information for the 2 different types of configurations [thanks to LucD‘s great posts about PowerCLI and obtaining performance statistics]:

I’ve also added a small helper function in order for me to easily connect to vCenter servers [in production I have used a ValidateSet attribute to easily switch between my available vCenter servers, as well as using saved credentials in CliXML format to speed things up].

But now what?

In comes Pester…

In case you haven’t used Pester yet, it’s awesome!

According to the creators of Pester, this is what it does:

Pester is the ubiquitous test and mock framework for PowerShell.

It provides a means for you to make tests for your code, making sure it does exactly what you need/want it to do, or tell you if it doesn’t!
At least, that’s what it was made out to be.
For a while now, people have started using Pester for infrastructure testing, to simple see if an environment is behaving as it should!

Now this post won’t get into the nitty gritty of “What’s the Pester syntax” or “Why have you used X instead of Y”, perhaps I’ll do another post on that later, it’s just to show you the possibilities and power of PowerShell when combined with something like Pester.

For example, I’ve simply used PowerShell looping techniques within Pester to loop through all the found VMs, get all of their disks and check each and every one of them if they meet the set requirements.

The power of Pester lies it’s simplicity and readability [quite similar to PowerShell itself], as well as the fact that it can harness all of the other capabilities PowerShell has.

By your powers combined…

So what we have is PowerShell functions that can obtain performance information from both VMs and VM Hosts, combined with Pester tests that check if the desired systems meet required performance needs.

And it goes a little something like this:

In total this runs approximately 450 tests in just a few seconds, depending on if I used saved credentials or if I have to manually provide them [then it takes approximately 60 seconds, give or take]

Here’s a link to the actual Pester test along with the other scripts in the same folder [required due to dot sourcing] for you to try out/look into.

Be sure to of course check and correct the machine names to look for, but you can start the Pester test by running

And the final verdict is:

For the people interested in the results:

It turned out our McAfee Anti-Virus solution had had an update and all of a sudden had stopped implementing our exclusions on all levels [Front end as well as Back end].
The test showed high CPU spikes on the AV machines at times of the reports and we were able to create a ticket in order to get it resolved.

The speed at which I was able to run and reproduce these tests meant we had ample sources of information for McAfee to use to resolve this matter and for me to prove to my colleagues they should finally make an effort into learning PowerShell!

 

I hope to have time soon to make some more Pester based blogs, perhaps I’ll be able to dive more into syntax examples for those of you that still have questions, but hopefully this shows a fun and exiting way to increase your usage of PowerShell in your environment!

Happy Scripting! 🙂

 

 

Facebooktwitterredditlinkedinmail