When I run the following statement from a SQL 2008 server against a SQL 2012 instance:
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.SMO") | out-null
$server = New-Object 'Microsoft.SqlServer.Management.SMO.Server' ("MySQLServer")
I get the following error:
format-default : Index was outside the bounds of the array.
+ CategoryInfo : NotSpecified: (:) [format-default], IndexOutOfRangeException
+ FullyQualifiedErrorId : System.IndexOutOfRangeException,Microsoft.PowerShell.Commands.FormatDefaultCommand
The same statement can successfully be run against a SQL 2008 R2 instance, again from a SQL 2008 server. In all cases, the operating system is Windows 2008 R2 SP1.
I've seen there's another closed bug for a similar error trying to connect to 2012 using 2005/2008 SSMS (bug 666386) - is this the same issue?