Export (0) Print
Expand All
Expand Minimize

Server.LinkedServers Property

Represents a collection of LinkedServer objects. Each LinkedServer object represents a linked server registered on the instance of SQL Server.

Namespace:  Microsoft.SqlServer.Management.Smo
Assembly:  Microsoft.SqlServer.Smo (in Microsoft.SqlServer.Smo.dll)

<SfcObjectAttribute(SfcContainerRelationship.ObjectContainer, SfcContainerCardinality.ZeroToAny,  _
	GetType(LinkedServer))> _
Public ReadOnly Property LinkedServers As LinkedServerCollection 
Dim instance As Server 
Dim value As LinkedServerCollection 

value = instance.LinkedServers

Property Value

Type: Microsoft.SqlServer.Management.Smo.LinkedServerCollection
A LinkedServerCollection object that represents all the linked servers registered on the instance of SQL Server.

The LinkedServers property points to the LinkedServerCollection object. You can use the collection to reference the linked servers registered on the instance of SQL Server.

Visual Basic

'Connect to the local, default instance of SQL Server.
Dim srv As Server
srv = New Server
'Display the linked servers.
Dim lksv As LinkedServer
For Each lksv In srv.LinkedServers



$srv = new-object Microsoft.SqlServer.Management.Smo.Server("(local)")
foreach ($lksv in $srv.LinkedServers)
   Write-Host $lksv.Name
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

© 2014 Microsoft