PIServers.Remove Method (Guid)
- Last UpdatedNov 18, 2025
- 2 minute read
- PI System
- AF SDK 2024 R2
- Developer
Unregisters an existing PIServer with the specified unique identifier.
Namespace: OSIsoft.AF.PI
Assembly: OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182
Syntax
public bool Remove( Guid id )
Public Function Remove ( id As Guid ) As Boolean Dim instance As PIServers Dim id As Guid Dim returnValue As Boolean returnValue = instance.Remove(id)
public: bool Remove( Guid id )
member Remove : id : Guid -> bool
Parameters
- id
- Type: SystemGuid
The unique identifier of the PIServer to be unregistered.
Return Value
Type: BooleanReturns if the item is successfully removed; otherwise, . This method also returns if id was not found in the original collection.
Exceptions
| Exception | Condition |
|---|---|
| InvalidOperationException | This exception is thrown if an attempt is made to remove the last PIServer in the list. |
Remarks
This method is used to unregister an existing PIServer entry from the list of
known PI Data Archive servers on the local machine. This does not affect the configuration
of servers on other client computers.
| The last PIServer in the list is not allowed to be removed. |