Powershell not able to access CMS when sql 2008 R2 default RRS feed

  • Question

  • Issue:

    CMS is accesible under SSMS and able to run queries.... Though when trying to access CMS from powershell its not seeing any registered server...

    Open powershell by right click on SSMS
    cd 'SQLSERVER:\sqlregistration\Central Management Server Group'
    dir | Select pschildname
        returns nothing

    cd 'SQLSERVER:\sqlregistration\Central Management Server Group'
    new-item CMSSQL2012
        return very beatiful error messsage:

    PS SQLSERVER:\sqlregistration\Central Management Server Group> new-item CMSSQL20
    New-Item : SQL Server PowerShell provider error: Could not create 'CMSSQL2012':
     Cannot create a server group immediately underneath the Central Management Ser
    ver Group. [Cannot create a server group immediately underneath the Central Man
    agement Server Group.]
    At line:1 char:9
    + new-item <<<<  CMSSQL2012
        + CategoryInfo          : OperationStopped: (SQLSERVER:\sqlr...roup\CMSSQL
       2012:SqlPath) [New-Item], GenericProviderException
        + FullyQualifiedErrorId : CouldNotCreate,Microsoft.PowerShell.Commands.New

    Select @@version:
    Microsoft SQL Server 2012 RC0 - 11.0.1750.32 (X64)
     Nov  4 2011 17:54:22
     Copyright (c) Microsoft Corporation
     Enterprise Evaluation Edition (64-bit) on Windows NT 6.1 <X64> (Build 7601: Service Pack 1) (Hypervisor)


    Instance name: VSACSQLBAK01\VSACSQLBAK012012


    Background: I has sql2008 R2 installed on this server and using powershell to access and collect stats regularily...installed SQL 2012 RC0 as new instance, dropped old CMS from sql 2008 R2 and added new in SQL2012 RC0 and imported all servers....able to access it fine no issue from SSMS

    But powershell do not see it.....

    Possibele issues:
    Could be named instances are not supported (less likely)
    SQL 2012 CMS have not been tested with powershell (less likely, though nothing in documentation suggests its done, its working for me as expected on another w2k8R2 box at home with sql2012 & RC0)
    maybe sql2012 needs some updated from powershell side 3.0?
    SQL 2008 R2 as default and SQL 2012 as named instances has some conflict (most likely, as it does shows not a default location, forgot when did I saw that during troubleshooting)

    whats going on anybody tested?

    For now I am going to build new VM and install sql 2012 as default as I know that worked before....

    Prakash Heda | Sr Infrastructure DBA | Advent Software | http://www.sqlfeatures.com

    Tuesday, February 7, 2012 12:56 AM