Home Forums Programming Powershell How do you connect to Central Management Servers if your server has an instance name with it RE: How do you connect to Central Management Servers if your server has an instance name with it

  • Here is what I am getting if I use a single quote around the server and instance name:

    Get-ChildItem : Cannot find path 'SQLSERVER:\SQLRegistration\Central Management Server Group\'Server\InstanceName'\NonProd

    \Dev' because it does not exist.

    At C:\SQL\CMS_Query.ps1:16 char:24

    + $instanceNameList = dir <<<< $serverGroupPath -recurse | select-object Name -Unique

    + CategoryInfo : ObjectNotFound: (SQLSERVER:\SQLR...com\NonProd\Dev:String) [Get-ChildItem], ItemNotFoundException

    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetChildItemCommand