While attempting to migrate from SCOM 2007 to SCOM 2012, I encountered a number of servers that were not configured for remote PowerShell sessions. We tried to force running WinRM QuickConfig but received an error indicating that the server was missing needed http and https SPN values. The following script is what I came up with the resolve the missing SPN values. Once this was resolved I was able to enable PS Remoting and could then install the new 2012 agent.
Please note that this script can simply be run via PowerShell and will relaunch itself elevated if it detects it is not already elevated. Once the SPN is fixed it enables PS Remoting. Please also note that if the required SPN values exist then the command is not processed. This script is for 2008 and newer servers, Server 2003 does not have the SETSPN program available.
[code ]$ErrorAction = "SilentlyContinue"
function Use-RunAs
{
# Check if script is running as Adminstrator and if not use RunAs
# Use Check Switch to check if admin
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.