5

I right click an SQL server database MyDB in SSMS and select "start powershell". However, I got the following error. And it's quite slow?

WARNING: Could not obtain SQL Server Service information. An attempt to connect to WMI on 'MyServer' failed with the following error: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
cd : SQL Server PowerShell provider error: Could not connect to 'MyServer\MyDB'. [Failed to connect to server MyServer\MyDB.

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)]

At line:1 char:155
+ ... MyServer\MyDB'']/Database[@Name=''MyDB'']'|cd}
+ ~~
+ CategoryInfo : OpenError: (SQLSERVER:\SQL...s\MyDB:SqlPath)[Set-Location], GenericProviderException
+ FullyQualifiedErrorId: ConnectFailed,Microsoft.PowerShell.Commands.SetLocationCommand

cd : SQL Server PowerShell provider error: Could not connect to 'MyServer\MyDB'. [Failed to connect to server MyServer\MyDB.

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)]

At line:1 char:155
+ ... MyServer\MyDB'']/Database[@Name=''MyDB'']'|cd}
+ ~~
+ CategoryInfo : OpenError: (SQLSERVER:\SQL...RTING\Databases:SqlPath) [Set-Location], GenericProviderException
+ FullyQualifiedErrorId: ConnectFailed,Microsoft.PowerShell.Commands.SetLocationCommand

cd : SQL Server PowerShell provider error: Could not connect to 'MyServer\MyDB'. [Failed to connect to server MyServer\MyDB.

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)]
At line:1 char:155
+ ... MyServer\MyDB'']/Database[@Name=''MyDB'']'|cd}
+ ~~
+ CategoryInfo : OpenError: (SQLSERVER:\SQL...1\MyDB:SqlPath) [Set-Location], GenericProviderException
+ FullyQualifiedErrorId : ConnectFailed,Microsoft.PowerShell.Commands.SetLocationCommand

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
ca9163d9
  • 27,283
  • 64
  • 210
  • 413

1 Answers1

0

Right-click on SSMS icon and select 'Run as Administrator'. Running SSMS as Administraotr also run Powershell with administrator privileges.