Skip to content
Menu
The Lonely Administrator
  • PowerShell Tips & Tricks
  • Books & Training
  • Essential PowerShell Learning Resources
  • Privacy Policy
  • About Me
The Lonely Administrator

PowerShell Quick Start on Server Core R2

Posted on March 29, 2010August 20, 2011

The great thing about the Server Core flavor that ships with Windows Server 2008 R2 is that it finally supports Windows PowerShell. I’ve talked about this before. However, I think I neglected some of the finer points in getting started. You can (and should) run PowerShell on your R2 Core servers. More than likely you will first have to install it.

Manage and Report Active Directory, Exchange and Microsoft 365 with
ManageEngine ADManager Plus - Download Free Trial

Exclusive offer on ADManager Plus for US and UK regions. Claim now!

After you’ve started the server and logged on as an administrator, at the C: prompt run this command first:

C:\> start /wait ocsetup NetFx2-ServerCore

This will load the requisite .NET Framework. Once installed, you can setup Windows PowerShell.

C:\> start /wait ocsetup MicrosoftWindowsPowerShell

The main reason you want this is because Server Core does not support SetupManagerCMD. Instead you’ll find it easier to start PowerShell from the C: prompt.

C:\> powershell

Once in PowerShell, load the ServerManager module.

PS C:\> import-module ServerManager

Now you’ll have access to the Add-WindowsFeature cmdlet. This is a much easier way to add roles and features. Of course, I prefer to then manage them remotely from another full server. Or even better, use the Remote Server Administration Tools on Windows 7.

While you’re at it, you should also configure the server’s execution policy and WinRM settings for remoting, assuming you aren’t using Group Policy.

PS C:\> set-executionpolicy remotesigned

PS C:\> enable-psremoting

If you want to see how to make PowerShell the default shell on Server Core, take a look back at this post from earlier this year.

Finally, if you accidentally exit your PowerShell session you’ll be left with an empty desktop.  Press Ctrl-Alt-Del and either log off so you can log on again. Or choose Task Manager. In Task Manager, go to File – NewTask (Run) and type powershell.  Or if you need the legacy shell type cmd. You can have as many shells open as you want.

I’m very interested to hear about your experiences with PowerShell on Server Core.

Followup: I assumed server manager was already installed. To be able to use the ServerManager module it first needs to be installed:

start /wait ocsetup ServerManager-PSH-Cmdlets


Behind the PowerShell Pipeline

Share this:

  • Click to share on X (Opens in new window) X
  • Click to share on Facebook (Opens in new window) Facebook
  • Click to share on Mastodon (Opens in new window) Mastodon
  • Click to share on LinkedIn (Opens in new window) LinkedIn
  • Click to share on Pocket (Opens in new window) Pocket
  • Click to share on Reddit (Opens in new window) Reddit
  • Click to print (Opens in new window) Print
  • Click to email a link to a friend (Opens in new window) Email

Like this:

Like Loading...

Related

2 thoughts on “PowerShell Quick Start on Server Core R2”

  1. Pingback: uberVU - social comments
  2. Marco Shaw says:
    May 22, 2010 at 9:31 pm

    It may be important to remember that this only installs the 64-bit compatible PowerShell. If you’re running 32-bit applications (I was testing SSH servers), they won’t “see” PowerShell.

    To install the 32-bit version, run the same 2 “start” commands above, but just tag on “-WOW64” to the end of the command-line (no spaces).

Comments are closed.

reports

Powered by Buttondown.

Join me on Mastodon

The PowerShell Practice Primer
Learn PowerShell in a Month of Lunches Fourth edition


Get More PowerShell Books

Other Online Content

github



PluralSightAuthor

Active Directory ADSI Automation Backup Books CIM CLI conferences console Friday Fun FridayFun Function functions Get-WMIObject GitHub hashtable HTML Hyper-V Iron Scripter ISE Measure-Object module modules MrRoboto new-object objects Out-Gridview Pipeline PowerShell PowerShell ISE Profile prompt Registry Regular Expressions remoting SAPIEN ScriptBlock Scripting Techmentor Training VBScript WMI WPF Write-Host xml

©2025 The Lonely Administrator | Powered by SuperbThemes!
%d