我正在研究使用 SQLPS 模块;PowerShell 3.0 版。运行Get-SqlInstance时,我一直收到以下错误。
PS 11/16/2015 08:34:29> $cred = Get-Credential
cmdlet Get-Credential at command pipeline position 1
Supply values for the following parameters:
PS 11/16/2015 08:44:28> $instance = Get-SqlInstance -MachineName SM1208 -Credential $cred
Get-SqlInstance : The operation failed on target server 'SM1208'. Verify that the target server is accessible and that the SQL Server
Cloud Adapter service is running.
At line:1 char:13
+ $instance = Get-SqlInstance -MachineName SM1208 -Credential $cred
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ResourceUnavailable: (SM1208:String) [Get-SqlInstance], SqlPowerShellRemoteOperationFailedException
+ FullyQualifiedErrorId : RemoteOperationFailedError,Microsoft.SqlServer.Management.PowerShell.IaaS.GetSqlInstanceCommand
我已经尝试过使用 localhost、IP 和另一个托管 SQL Server 实例的服务器。还使用 -Name 来指定实例名称。每次都是同样的错误。SQL Server 实例正在主机上运行。
PS 11/16/2015 08:44:55> Get-ExecutionPolicy
RemoteSigned
有任何想法吗?谢谢