I've recently started using the Server Core option for my test servers, especially for things like domain controllers. I can get by with smaller disk and memory requirements. Once you get the server configured, there's very little you have to do that actually requires logging on to the server. Which is good because all you have is a C:\ prompt, which I know makes some people a little uncomfortable. But with Windows Server 2008 R2, there is another option: PowerShell.
ManageEngine ADManager Plus - Download Free Trial
Exclusive offer on ADManager Plus for US and UK regions. Claim now!
I've started experimenting with Windows PowerShell as my default shell on an R2 Server Core installation. Now when I logon I get a PowerShell window, not a CMD window. I can setup a PowerShell profile and be fully ready to manage my server. Of course there's so much I can do remotely now but for the sake of discussion let's say I have a need to logon to the console. Normally I would get a CMD window. And while I could start PowerShell from the C:\ prompt, if I know I always want PowerShell, why not make it the default?
The change is very easy to do. But because it involves the registry: backup and test thoroughly in a non-production environment. The registry key to change is HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\winlogon. Look for the Shell entry. Here's how you can do it with PowerShell:
[cc lang="PowerShell"]
PS C:\> get-itemproperty "hklm:\software\microsoft\windows nt\currentversion\winlogon" shell
PSPath : Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\software\microsoft\windows nt\currentversion\winlogon
PSParentPath : Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\software\microsoft\windows nt\currentversion
PSChildName : winlogon
PSDrive : HKLM
PSProvider : Microsoft.PowerShell.Core\Registry
shell : cmd.exe /c "cd /d "%USERPROFILE%" & start cmd.exe /k runonce.exe /AlternateShellStartup"
[/cc]
Notice the shell value is essentially a CMD.EXE shell. We can change that value to anything we want. But first, let's save the value in case we ever want to revert back. You could simply export the entire Winlogon key, but I'm going to simply grab the shell value and save it to a file.
[cc lang="PowerShell"]
PS C:\> get-itemproperty "hklm:\software\Microsoft\windows NT\currentversion\winlogon" Shell | select -ExpandProperty Shell | out-file savedshell.txt
[/cc]
If I ever need to restore this value, I would do something like this:
[cc lang="PowerShell"]
PS C:\> $shell=get-content .\savedshell.txt
PS C:\> $shell
cmd.exe /c "cd /d "%USERPROFILE%" & start cmd.exe /k runonce.exe /AlternateShellStartup"
PS C:\> set-itemproperty "hklm:\software\microsoft\windows nt\currentversion\winlogon" shell $shell
[/cc]
But now my shell is set to PowerShell. I logoff and back on and I now have a PowerShell prompt. I can still run commands like the sconfig script and other CMD tools. So far I haven't found any downside to changing the default shell but if you know of any, please let me know.