TargetServerGroup.AddMemberServer Method

Assigns target server group membership to the specified target server.

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

Syntax

'Declaration
Public Sub AddMemberServer ( _
    srvname As String _
)
'Usage
Dim instance As TargetServerGroup 
Dim srvname As String

instance.AddMemberServer(srvname)
public void AddMemberServer(
    string srvname
)
public:
void AddMemberServer(
    String^ srvname
)
member AddMemberServer : 
        srvname:string -> unit
public function AddMemberServer(
    srvname : String
)

Parameters

  • srvname
    Type: System.String
    A String value that specifies the target server to be removed from the target server group.

Remarks

Use the AddMemberServer and RemoveMemberServer methods to configure multi-server administration target server groups. A target server can be a member of no group or a member of multiple groups.

Examples

Scheduling Automatic Administrative Tasks in SQL Server Agent

See Also

Reference

TargetServerGroup Class

Microsoft.SqlServer.Management.Smo.Agent Namespace

Other Resources

Automated Administration Tasks (SQL Server Agent)

sp_add_targetsvrgrp_member (Transact-SQL)