I've been diving a bit deeper into the Nano waters now that Windows Server 2016 is out the door. As I deployed a few servers I realized there was a potential long-term management issue. During the technical preview, Nano installations were recognized by their Tuva designation. But now, a Nano server is just another Windows Server 2016 installation. So how can I tell if a server is a Nano installation? Here's the solution I came up with.
ManageEngine ADManager Plus - Download Free Trial
Exclusive offer on ADManager Plus for US and UK regions. Claim now!
One solution you could use is the new Get-ComputerInfo cmdlet. On one hand this is an awesome cmdlet because it provides a wealth of system information.
And I could use it to identify Nano server through the WindowsEditionID property. However, this cmdlet only exists on Windows Server 2016 and has no remote computer options so you have to run it through a PSSession.
$computers = "chi-p50.globomantics.local", "nano-01.globomantics.local", "chi-test01.globomantics.local", "chi-test03.globomantics.local" $cred = Get-Credential globomantics\jeff invoke-command -scriptblock { get-computerinfo | select CSName,windowsEditionID,WindowsProductName} -computer $computers -Credential $cred -hidecomputername | select * -ExcludeProperty RunspaceID
Granted, it works.
But if I want to search a disparate list of servers, I'll have to incorporate a lot of error handling. Likewise, there is also a Nano only registry key I could search for, but that doesn't scale well.
What I wanted was a way to identify a Nano server installation without having to rely on Windows Server 2016 or PowerShell 5.1. The answer is buried in the Win32_OperatingSystem class. The class has a property called OperatingSystemSKU. If you read the documentation you'll see that different operating system have different values. A Nano server will have a value of 143 or 144 depending on whether you installed Datacenter or Standard. From my perspective this approach is greatly preferred because I can query any server as long as it supports PowerShell 3.0.
So I wrote this function which you can find as a gist on GitHub.
The function uses Get-CimInstance to query a remote computer and check the Win32_OperatingSystem class. By default the function writes a simple object to the pipeline.
Test-IsNanoServer -Computername $computers -Credential $cred | format-list
Or, like Test-Connection, I included a -Quiet parameter to return a simple True/False.
$computers | Where { Test-IsNanoServer $_ -Credential $cred -quiet}
Ideally, I'd love to see Get-ComputerInfo be extended to work remotely but for now I think my simple test function should meet my needs. I hope you'll start giving Nano Server a spin. If you do, I'd love to hear about your pain points.
If you have comments or issues with my function, please post a comment on the Gist page.