28.09.2016 Views

Introducing

IntroducingWindowsServer2016_ebook

IntroducingWindowsServer2016_ebook

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Remotely managing Nano Server<br />

Nano Server is truly headless—there is no way to use Remote Desktop to connect remotely. As a<br />

result, you must perform all Nano Server management remotely, either via Windows PowerShell,<br />

Windows Management Instrumentation (WMI), Windows Remote Shell (WinRS), Emergency<br />

Management Services (EMS), or remote GUI tools.<br />

Note The options discussed in this section to remotely manage Nano Server are the same<br />

mechanisms that you can use to remotely manage Server Core. The only difference in managing<br />

Nano Server is that you must do it all remotely.<br />

Windows PowerShell<br />

Nano Server includes a refactored subset of Windows PowerShell called Core PowerShell, which is<br />

based on the CoreCLR. Core PowerShell provides the following:<br />

<br />

<br />

<br />

<br />

Full Windows PowerShell language compatibility<br />

Full Windows PowerShell remoting<br />

Most core engine features<br />

Support for all cmdlet types, including C#, Windows PowerShell, and CIM<br />

Because Nano Server includes Core PowerShell, it is possible to use Windows PowerShell Remoting to<br />

manage Nano Server. To do so, you need to be an administrator on the Nano Server machine and add<br />

its IP address to the management machine's trusted hosts. To do that, from an elevated Windows<br />

PowerShell prompt, run the following command (which, for this example, assumes the Nano Server<br />

machine’s IP address is 192.168.1.10):<br />

PS C:\> Set-Item WSMan:\localhost\Client\TrustedHosts "192.168.1.10"<br />

The following is an example of how to start an interactive remoting session:<br />

PS C:\NanoServer> $ip = "192.168.1.10"<br />

PS C:\NanoServer> $user = "Administrator"<br />

PS C:\NanoServer> Enter-PSSession -ComputerName $ip -Credential $user<br />

After you have done this, you can now run any available Windows PowerShell command as if you<br />

were entering it directly into the Nano Server console; for example:<br />

[192.168.1.10]: PS C:\users\user1\Documents> Get-Process w*<br />

[192.168.1.10]: PS C:\users\user1\Documents> ipconfig /all<br />

Not all Windows PowerShell commands are available in Nano Server. To see which cmdlets are<br />

available, run the following command:<br />

[192.168.1.10]: PS C:\users\user1\Documents> Get-Command -CommandType Cmdlet<br />

To end the remoting session, run this command:<br />

[192.168.1.10]: PS C:\users\user1\Documents> Exit-PSSession<br />

WMI<br />

Nano Server includes WMI v1 and WMI v2 as well as the providers for the included functionality.<br />

94 CHAPTER 3 | Application platform

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!