Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Trying to connect to an instance of SQL Server 2008 on a server we'll call Sputnik. There are no firewalls in between the two devices.

Right now I'm just trying to list databases

[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.SMO") | Out-Null
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.SmoExtended") | Out-Null
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.ConnectionInfo") | Out-Null
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.SmoEnum") | Out-Null
$servername = "Sputnik"
$remoteServer = New-Object("Microsoft.SqlServer.Management.Smo.Server") $servername

The following error message occurs:

 The following exception was thrown when trying to enumerate the collection: 
 "Failed to connect to server Sputnik.".
 At line:1 char:15 + $remoteServer. <<<< databases 
 + CategoryInfo          : NotSpecified: (:) [], ExtendedTypeSystemException
 + FullyQualifiedErrorId : ExceptionInGetEnumerator
share|improve this question

A couple of suggestions: Since you're using Windows authentication does your Windows login have access to the remote server and are both machines on the same domain? Are you able to connect using other tools? One quick way to do so is to setup and ODBC connection: ODBC Data Source >> Add SQL Server >> Test Connection

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.