How to make PowerShell the default console for Windows Server Core

In a previous blog I demonstrated how to autologon a windows server using PowerShell. (You should read that one first). On Windows Server Core I prefer to have PowerShell as the default console instead of the command prompt. There is an Old-Skool way of changing this that still works today.

The registry key “HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon” contains a key named “Shell”. The default for this Explorer.exe and this launches the old command prompt.  If you change this to PowerShell, then when Core launches, PowerShell will be your default.

There is no security issue with this as in the last blog regarding AutoLogon, so you can safely do this in production. As a side note, my setup script for my lab environments perform both tasks, AutoLogon and making PowerShell the default. For my production servers I just only perform the PowerShell default task. You can do it standing at a single server and to multiple computers using PowerShell Remoting.

Single Server

PS C:\> Set-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon' -name Shell -Value 'PowerShell.exe -noExit'

Multiple servers using PowerShell Remoting

PS C:\> Invoke-Command -ComputerName S1, S2 -ScriptBlock { Set-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon' -name Shell -Value 'PowerShell.exe -noExit'}

Enjoy!

Knowledge is PowerShell,

Jason Helmick
Director of PowerShell Technologies
Interface Technical Training

Posted in PowerShell, Windows Server | Posted in , , , , , | Leave a comment

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">