I’ve written a bit recently about Server Core in Server 2012. But here’s yet more details. In Server 2012, the GUI is an installable feature – one you can add or remove. There are actually three levels of GUI within Server 2012:
As part of the Launch of Server 2012 here in the UK next week, I’ll be presenting a bit on PowerShell and showing some of what it can do. One aspect of the server we are showing is Server Core and I’ll be demoing how easy it is – I wrote a script for that:
- Full GUI – the full blown Windows Server GUI as we’ve always known it plus the Metro start panel, etc.
- MinShell – a partial GUI but one that enables you to run things like Server Manager, some control panel applets,MMC consoles and PowerShell ISE. But no desktop/Metro Shell and no IE.
- None – The server core GUI as we love it – but with the opportunity to specify PowerShell as the window to open at boot (or when you RDP into it).
As part of the Launch of Server 2012 here in the UK next week, I’ll be presenting a bit on PowerShell and showing some of what it can do. One aspect of the server we are showing is Server Core and I’ll be demoing how easy it is – I wrote a script for that:
Function Set-GUI {This could usefully have been added into the ServerCore Module!
[Cmdletbinding()]
Param(
[ValidateSet("Full", "MinShell", "None")]
[String] $GuiType = "Full"
) # Here check what to do and do it Switch ($GuiType) { "Full" { Add-WindowsFeature Server-Gui-Shell, Server-Gui-Mgmt-Infra
$RegPath = "Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\winlogon"
Remove-ItemProperty -Path $RegPath -Name Shell -ErrorAction SilentlyContinue –Force
} "MinShell" { Uninstall-WindowsFeature Server-Gui-Shell, Server-Gui-Mgmt-Infra # Just in case
Add-WindowsFeature Server-Gui-Shell
$RegPath = "Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\winlogon"
Set-ItemProperty -Path $RegPath -Name Shell -Value 'PowerShell.exe -noExit -Command "$psversiontable"' -Force
}
"None" { Uninstall-WindowsFeature Server-Gui-Shell, Server-Gui-Mgmt-Infra
$RegPath = "Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\winlogon"
Set-ItemProperty -Path $RegPath -Name Shell -Value 'PowerShell.exe -noExit -Command "$psversiontable"' -Force }Default {"$GuiType unknown - enter Full, MinShell or None"; return
}
} # Finally Reboot into new gui mode!
Restart-Computer
} # end of Set-GUI function
Technorati Tags: PowerShell,Server 2012 Server Core
1 comment:
You're missing a '}' to close the script block for "None".
Post a Comment