AFDataReference.ReplacePIServer Method (PISystem, String, String, EventHandler(AFProgressEventArgs))
- Last UpdatedJan 12, 2026
- 2 minute read
- PI System
- AF SDK 3.2.0
- Developer
Replaces the PI Data Archive server name with another server name on the PI Point and PI Point Array data references found
within the attributes and attribute templates and its children of a PI System.
Namespace: OSIsoft.AF.Asset
Assembly: OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.2.0.7
Syntax
public static int ReplacePIServer( PISystem system, string oldServerName, string newServerName, EventHandler<AFProgressEventArgs> eventHandler )
Public Shared Function ReplacePIServer ( system As PISystem, oldServerName As String, newServerName As String, eventHandler As EventHandler(Of AFProgressEventArgs) ) As Integer Dim system As PISystem Dim oldServerName As String Dim newServerName As String Dim eventHandler As EventHandler(Of AFProgressEventArgs) Dim returnValue As Integer returnValue = AFDataReference.ReplacePIServer(system, oldServerName, newServerName, eventHandler)
public: static int ReplacePIServer( PISystem^ system, String^ oldServerName, String^ newServerName, EventHandler<AFProgressEventArgs^>^ eventHandler )
static member ReplacePIServer : system : PISystem * oldServerName : string * newServerName : string * eventHandler : EventHandler<AFProgressEventArgs> -> int
Parameters
- system
- Type: OSIsoft.AFPISystem
The PI System containing the attributes. - oldServerName
- Type: SystemString
The PI Data Archive server name that needs to be changed. - newServerName
- Type: SystemString
The PI Data Archive server name to change to. - eventHandler
- Type: SystemEventHandlerAFProgressEventArgs
Delegate used to receive progress indication on operations.
Return Value
Type: Int32Returns the number of data reference configurations that were modified.