Server Core remote management – Part 2

In my previous article, I showed you how to remotely manage Windows Server 2012–based Server Core installations with the Computer Management Snap-in (compmgmt.msc) and the Remote Server Administration Tools (RSAT). In this article, I will show you how to remotely manage Server Core installations with Remote Desktop, PowerShell, and WinRS.

Sander BerkouwerMVP By Sander Berkouwer - Mon, February 25, 2013 - 0 comments

Sander Berkouwer is a Microsoft Certified Professional and a Microsoft Most Valuable Professional (MVP) with over a decade of experience in IT.

Articles in this series

Windows Server 2012 Server Core

Remote Desktop

Remote Desktop has been used by systems administrators all over the world to manage Windows Servers. Remote Desktop is also available in Server Core installations of Windows Server 2012. This feature allows for domain-less connections, although it needs a rather steady connection between your client and your Server Core installation.

Remote Desktop, by default, is disabled in Server Core installations of Windows Server 2012. To enable it, either use option 7 of sconfig.cmd or use SCRegEdit.wsf with the /AR 0 command line switches.

Remote Desktop Connection application

On the client, you can use the Remote Desktop Connection application (mstsc.exe) to connect to the Server Core installation. This little utility is built into Windows. You can start it by typing either part of its name or its full filename in the Start Menu or Start Screen.

Remote Desktop Connection

Remote Desktop Connection

You can use the netBIOS hostname, fully qualified DNS name, IPv4 address, or IPv6 address (between brackets) to point the Remote Desktop Connection to your Server Core installation. Provide credentials and you’re done.

Remote Desktop app

When you’re on Windows 8 and looking for an application where you can use Remote Desktop with a vast number of Server Core installations, another option is to use the free Remote Desktop app, published by Microsoft.

This app uses the new Modern user interface of Windows 8 and is fast, fluid, and beautiful. At the bottom of the main screen of the app is an address bar, where you can insert hostnames and addresses just as you would with the built-in Remote Desktop Connection application.

When you’ve used the Remote Desktop app to connect to a remote host, a tile for the remote host becomes available in the main screen, allowing you to easily reconnect to previous hosts. When you are in multiple Remote Desktop sessions at once, you can quickly switch between sessions through the App bar (Win+Z). For true multitasking heaven, you can snap the Remote Desktop app to the side. When in 1/3 mode, the app displays a list of active sessions and allows for new and reconnecting sessions. When in 2/3 mode on the desktop, the app displays the Remote Desktop and your desktop apps as tiles. Remote management through Remote Desktop will never be easier!

PowerShell

Since Windows 7, PowerShell has been built into Windows. The latest version to date, PowerShell 3.0, is built into Windows 8 and Windows Server 2012. Both versions of PowerShell offer remote block execution so you can run scripts remotely against Server Core installations of Windows Server 2008 R2 and Windows Server 2012. Also, many PowerShell cmdlets allow you to redirect the action to a remote computer. These two methods are very powerful and allow you to quickly and easily configure settings on Server Core installations.

Note:
While Windows 8 and Windows Server 2012 share the latest PowerShell version to date, PowerShell 3.0, Windows 7 has an older version of PowerShell built in. Not all PowerShell modules and cmdlets from your Server Core installation are available in Windows 7, unless you upgrade the PowerShell version of your Windows 7 client to PowerShell 3.0 with this update.

PowerShell does not require a steady connection like Remote Desktop does, but it is pickier on the trust relationship between the two hosts. For optimal management, make sure both your Windows client and your Server Core installation are joined to the same domain on the same network segment.

An example of a PowerShell cmdlet that lets you redirect the action to a remote computer is the Restart-Computer cmdlet. Using the remote PowerShell feature with this cmdlet, you can restart Windows Server remotely when you have the right credentials. The command below restarts your Server Core installation:

Another way to use PowerShell with a remote Server Core installation is to use the Remote Code Block feature in PowerShell. This feature is located within the Invoke-Command PowerShell cmdlet. A prime example of using a remote code block would be to get a listing of all the running services on a group of servers. The following one-liner does exactly this:

WinRS

Windows Remote Management (WinRM) is the basis for most of the aforementioned remote management methods. It can also be remotely addressed through WinRS. What’s even better is that your Server Core installations are already set up by default to accept WS-Management calls from WinRS.

To start remotely managing Server Core installations from Windows 7 or Windows 8, simply start a command prompt (cmd.exe) with administrative privileges and type:

You will now have a command prompt on the remote Server Core installation. You can check this by typing hostname, for instance, to return the hostname for the server:

Windows 8 WinRS

Windows 8 WinRS

Now you can execute the commands you like. You can even start PowerShell and use its cmdlets. When done, type exit to exit your WinRS session. Note that the command prompt on the Windows 8 installation will remain active.

Because it is based on WS-Management, WinRS is easily used in environments where both the Server Core installation and your management workstation are joined to the same Active Directory domain. When they’re not, you will have to make the two installations trust each other by lowering their security toward each other.

Note:
The built-in security of your Server Core installation will be lowered by the commands below. Do not perform these actions in a highly secure environment.

On your Server Core installation

Run the following commands on the console of your Server Core installation to lower security:

On your Windows client

Start a Command Prompt with elevated privileges. On machines with User Account Control enabled, this is easily achieved by typing cmd in the Start Menu or Start Screen and pressing CTRL and SHIFT, together with Enter, to run the command. Run the following commands on the remote host to lower security:

Now, to open a command prompt on your Server Core installation with the appropriate credentials, use the following command from your Windows client:

Concluding

Remotely managing Windows Server 2012–based Server Core installations differs between Windows 7 and Windows 8. Windows 8 seems more in tune with the technologies and remote management vision in Windows Server 2012, and it is therefore my tool of choice from which to remotely manage Server Core installations.

Series NavigationServer Core remote management – Part 1 -

-1+1 - Rate this post
Loading ... Loading ...
Your question wasn't answered? Ask in the new 4sysops forum!
===Leave a Comment===

Login

Lost your password?