PowerShell How-To

Installing Windows Admin Center on Windows Server Core

Windows Server Core is the epitome of Microsoft's shift toward GUI-free. But since you can't beat a good dashboard, here's how to access the GUI remotely.

Taking a cue from Linux, these days Microsoft isn't a fan of GUIs on servers. It believes, and rightfully so, that point-and-click GUIs are meant for client workstations.

Servers, on the other hand, should be workhorses that everyone uses but never sees. Windows Server Core is the epitome of this GUI-less mentality, where it's not possible to add a GUI to the server itself.

Microsoft gives us other ways to manage our Windows servers using languages like PowerShell, but you still can't beat a beautiful dashboard showing useful metrics and windows where you can quickly tweak settings, rather than learning complicated syntax.

What are we to do since Server Core doesn't have this ability? We get our GUIs remotely.

Command-line junkies have known for a long time that much of what's available via the Windows Server GUI is available remotely by querying a server's WMI/CIM repository. The PowerShell command Get-CimInstance can open up a wealth of information if you know how to use it correctly. Windows Admin Center also leverages WMI/CIM and other technologies to remotely -- not locally -- manage Windows Server.

That said, how do we get our hands on Windows Admin Center and begin shunning GUIs with Windows Server Core? I'm glad you asked!

We first need to open up a PowerShell console and establish a PowerShell Remoting session to the server. To do that, we use the Enter-PSSession command and optionally provide a credential. If the local computer and the server are in the same domain, passing a credential wouldn't be necessary.

$cred = Get-Credential
Enter-PSSession WAC01 -Credential $cred

This establishes an interactive session on the Server Core server. We next need to download the Windows Admin Center installer. To do that, we can use PowerShell's Invoke-WebRequest command, passing the URL to the installer and saving it to a file, as you can see below.

$dlPath = 'C:\Users\Administrator\Downloads\WAC.msi'
Invoke-WebRequest 'http://aka.ms/WACDownload' -OutFile $dlPath

Once the installer is downloaded, we can now start the installer by using the msiexec command, providing some common installer switches and using the SME_PORT and SSL_CERTIFICATE=generate switches to tell the installer to set up Windows Admin Center listening on the SSL port of 443 and generate a self-signed certificate.

$port = 443
msiexec /i $dlPath /qn /L*v log.txt SME_PORT=$port SSL_CERTIFICATE_OPTION=generate

Windows Admin Center can be installed with an existing certificate if you already have one. To do that, you'd need to find the certificate thumbprint and use the SME_THUMBPRINT switch along with the installed value for the SSL_CERTIFICATE_OPTION switch, as shown below.

$port = 443
msiexec /i $dlPath /qn /L*v log.txt SME_PORT=$port SME_THUMBPRINT=$CertThumprint SSL_CERTIFICATE_OPTION=installed

This install may take a bit, but once it's done, it will automatically initiate a server reboot and the install will be finished. For more information on this process, check out the Microsoft install documentation.

About the Author

Adam Bertram is a 20-year veteran of IT. He's an automation engineer, blogger, consultant, freelance writer, Pluralsight course author and content marketing advisor to multiple technology companies. Adam also founded the popular TechSnips e-learning platform. He mainly focuses on DevOps, system management and automation technologies, as well as various cloud platforms mostly in the Microsoft space. He is a Microsoft Cloud and Datacenter Management MVP who absorbs knowledge from the IT field and explains it in an easy-to-understand fashion. Catch up on Adam's articles at adamtheautomator.com, connect on LinkedIn or follow him on Twitter at @adbertram or the TechSnips Twitter account @techsnips_io.

comments powered by Disqus
Most   Popular