2

I am researching using SQLPS module; PowerShell version 3.0. When running Get-SqlInstance, I consistently get the following error.

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

I have tried this using localhost, the IP, and a different server that also hosts SQL Server instances. Also used the -Name to specify the instance name. Same error each time. SQL Server instance is running on the hosts.

PS 11/16/2015 08:44:55> Get-ExecutionPolicy
RemoteSigned

Any ideas? Thanks

user5568582
  • 21
  • 1
  • 2
  • `verify that (...) SQL Server Cloud Adapter service is running` ? And if it is, would it possibly be a firewall issue ? – sodawillow Nov 16 '15 at 18:08
  • Thanks. I guess the SQL Server Cloud Adapter is required... not sure why this would be forced on users. – user5568582 Nov 16 '15 at 20:14

2 Answers2

1

From the error, and confirmed by OP, it seems a needed service on the target host is missing:

Verify that (...) SQL Server Cloud Adapter service is running.

Toby Speight
  • 27,591
  • 48
  • 66
  • 103
sodawillow
  • 12,497
  • 4
  • 34
  • 44
1

Try: Get-Item SQLSERVER:\SQL\machinename\instancename

AndKan
  • 11
  • 1