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

VM Lab – Switch it up

Back again for another part in my VM Lab series.

So far I’ve created the folder structure which we will use to store our ISO files, VHD files [including template VHDs and Unattend.xml files] and VM’s.
In order to manipulate the ReadOnly status of various files [such as the template VHD’s and Unattend.xml files], I’ve provided simple functions which will assist us.

Now we need to make sure that the final piece of the infrastructure is ready: the Hyper-V VM Switches.

Breakdown

As a change of scenery, this time I won’t just dump the code, I’ll try and explain my reasoning behind the code used.
Since the 3 functions [again going for Get- , New- and Remove-] all use the same base structure, I thought it would be nice to explain some method to my madness.
If this isn’t what you’ve come here for, please scroll down to the end of the page and just scoop the final code 🙂

Advanced functions – ValidateSet

There are only select options to choose when creating a VM Switch: External, Internal, Private (and in some versions NAT, but this is not included in my function for now).
In order to limit the user’s choices, I’ve used something called ValidateSet, which gives the end user a predefined list of options to choose from.
Should you manually enter a value which is not defined in the ValidateSet list, access will be denied.

You can find various examples in common Cmdlets, such as

This will give you a predefined set of options to choose from, such as AllSigned, ByPass, Default, RemoteSigned, Restricted, Undefined and Unrestricted.
In my code I limit the user to the default VM Switch types, but I also provide an option to select all 3 types at the same time, All.

This does however require your function to be an advanced function, as defined by

In case you didn’t know yet, adding something as simple as that will provide your function with additional features and functionality, such as being able to use CommonParameters, such as –Verbose or -WhatIf.

For a more in depth view of Standard functions vs Advanced functions, I’d like to refer to these great articles by the following great minds:

Switch statement

Now these are functions about VM Switches, but in my code I also use something called a switch statement.
This allows me to set/change values, based on what value was chosen in my ValidateSet.
There is a great article on Microsoft’s TechNet by The Scripting Guys, which will explain the entire concept better than I can do, so please have a look at that if anything is unclear about the options/usage of this statement.

In my case, this is the logic I used behind it:

At first I have defined all types of VM Switches as a variable

Now through the switch statement, I check which $SwitchType has been selected and I change the accompanying variable to $true

If statement

After the variables are set to either $true or $false using the above mentioned switch statement, I use an if statement which will execute certain code if the value is set to $true.
If the variable is set to $false,  you can have it do something else, of elseif, but for this code it wasn’t important.

By doing this, I can check each VM SwitchType, and if it was set as $true, I would either get, create or remove the VM Switch.
In the above example I also use a try/catch block, but I will try and explain this in a future blog post.

Functions

As per usual, I’ve provided the final code below.

BEWARE

These functions are meant for a test environment.
I’ve borrowed Jeffery Hicks‘ disclaimer, because it simply says it all:

DO NOT USE IN A PRODUCTION ENVIRONMENT UNTIL YOU HAVE TESTED THOROUGHLY IN A LAB ENVIRONMENT.
USE AT YOUR OWN RISK.
IF YOU DO NOT UNDERSTAND WHAT THIS SCRIPT DOES OR HOW IT WORKS, DO NOT USE IT OUTSIDE OF A SECURE, TEST SETTING.

I’ve set the scripts to a max height as to not flood the page, but rest assured, everything’s there.
Please do note that functions might refer to other functions, this is intended as a complete toolset, not just 1 piece.

If you have questions on the techniques used or suggestions on how to improve something, please let me know in the comment section!

Get-LabSwitch

New-LabSwitch

Remove-LabSwitch

 

Facebooktwitterredditlinkedinmail

VM Lab – Read Only status

In this next installment of my  VM Lab series of posts, I have created a tiny set of tools which basically do exactly as the names imply.
While I admit, not quite hard to do, perhaps you’d even prefer to type things manually, but as mentioned in my previous post, for me it’s all about re-usability.

Requirements

In one of the upcoming installments of my VM Lab series, I will create a template VHD file, which will need to be set to Read Only in order to prevent changes to be made accidentally.
In another, I will need to copy a current Unattend.xml file, check if it was set to Read Only and if it was, remove that value so we can customize the contents.

So I made a small set of tools that did just that.

Functions

As the scripts aren’t too complex, but do server a solid purpose for the rest of the series, I’ve provided the code below.

BEWARE

These functions are meant for a test environment.
I’ve borrowed Jeffery Hicks‘ disclaimer, because it simply says it all:

DO NOT USE IN A PRODUCTION ENVIRONMENT UNTIL YOU HAVE TESTED THOROUGHLY IN A LAB ENVIRONMENT.
USE AT YOUR OWN RISK.
IF YOU DO NOT UNDERSTAND WHAT THIS SCRIPT DOES OR HOW IT WORKS, DO NOT USE IT OUTSIDE OF A SECURE, TEST SETTING.

I’ve set the scripts to a max height as to not flood the page, but rest assured, everything’s there.
Please do note that functions might refer to other functions, this is intended as a complete toolset, not just 1 piece.

If you have questions on the techniques used or suggestions on how to improve something, please let me know in the comment section!

Get-ReadOnly

Set-ReadOnly

Remove-ReadOnly

 

Facebooktwitterredditlinkedinmail