Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AF SDK Reference

PICollective.SwitchMember Method (NetworkCredential, PIAuthenticationMode, PICollectiveMember)

PICollective.SwitchMember Method (NetworkCredential, PIAuthenticationMode, PICollectiveMember)

  • Last UpdatedNov 18, 2025
  • 3 minute read
PICollective.SwitchMember Method (NetworkCredential, PIAuthenticationMode, PICollectiveMember)
The SwitchMember method is used to change to the specified member of the collective using the specified credentials.

Namespace:  OSIsoft.AF.PI
Assembly:  OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182

Syntax

public void SwitchMember(
	NetworkCredential credential,
	PIAuthenticationMode authenticationMode,
	PICollectiveMember member
)
Public Sub SwitchMember ( 
	credential As NetworkCredential,
	authenticationMode As PIAuthenticationMode,
	member As PICollectiveMember
)

Dim instance As PICollective
Dim credential As NetworkCredential
Dim authenticationMode As PIAuthenticationMode
Dim member As PICollectiveMember

instance.SwitchMember(credential, authenticationMode, 
	member)
public:
void SwitchMember(
	NetworkCredential^ credential, 
	PIAuthenticationMode authenticationMode, 
	PICollectiveMember^ member
)
member SwitchMember : 
        credential : NetworkCredential * 
        authenticationMode : PIAuthenticationMode * 
        member : PICollectiveMember -> unit 

Parameters

credential
Type: System.NetNetworkCredential
The NetworkCredential to use when connecting to the server.
authenticationMode
Type: OSIsoft.AF.PIPIAuthenticationMode
Specifies the type of authentication to be used when making the connection. The specified credential must match the type of authentication.
member
Type: OSIsoft.AF.PIPICollectiveMember
The preferred member of the PICollective selected for the connection. If the member is not available, then the connection will failover to another member.

Exceptions

ExceptionCondition
PIVersionNotSupportedException This exception will be generated when attempting to connect to a PIServer with using WindowsAuthentication and the server does not support this mode of authentication.

Remarks

This method will change the currently connected member of the collective to the specified member if the current Priority settings allow a connection to this member. This method will not modify the current failover behavior of the PICollective established with the initial connection to the collective.

A direct connection can be made to a collective member using one of the PICollectiveMember.Connect Overload methods. If the current connection to a collective member is a direct connection, then this method will establish a normal failover connection before switching members.

Version Information

AFSDK

Supported in: 3.1.1, 3.1.0, 3.0.2, 3.0.1, 3.0.0, 2.10.11, 2.10.5, 2.10.0, 2.10, 2.9.5, 2.9, 2.8.5, 2.8, 2.7.5, 2.7, 2.6

See Also

In This Topic
TitleResults for “How to create a CRG?”Also Available in