From 0dd06102ae9b5deb44b57cf597403d5182cc61a9 Mon Sep 17 00:00:00 2001 From: Dhrubomoy Das Gupta Date: Fri, 18 Mar 2016 13:21:16 -0400 Subject: [PATCH] Update Copy-SqlCentralManagementServer.ps1 --- Functions/Copy-SqlCentralManagementServer.ps1 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Functions/Copy-SqlCentralManagementServer.ps1 b/Functions/Copy-SqlCentralManagementServer.ps1 index b4075203c3..e4eee1abd3 100644 --- a/Functions/Copy-SqlCentralManagementServer.ps1 +++ b/Functions/Copy-SqlCentralManagementServer.ps1 @@ -173,6 +173,11 @@ PROCESS { if (!(Test-SqlSa -SqlServer $sourceserver -SqlCredential $SourceSqlCredential)) { throw "Not a sysadmin on $($sourceserver.name). Quitting." } if (!(Test-SqlSa -SqlServer $destserver -SqlCredential $DestinationSqlCredential)) { throw "Not a sysadmin on $($destserver.name). Quitting." } + if ($sourceserver.versionMajor -lt 10 -or $destserver.versionMajor -lt 10) { + throw "Central Management Server is only supported in SQL Server 2008 and above. Quitting." + + } + Write-Output "Connecting to Central Management Servers" try { $fromcmstore = New-Object Microsoft.SqlServer.Management.RegisteredServers.RegisteredServersStore($sourceserver.ConnectionContext.SqlConnectionObject) @@ -193,4 +198,4 @@ END { $destserver.ConnectionContext.Disconnect() If ($Pscmdlet.ShouldProcess("console","Showing finished message")) { Write-Output "Central Management Server migration finished" } } -} \ No newline at end of file +}