SetAFServer Class
- Last UpdatedDec 15, 2025
- 4 minute read
Sets an AF Server connection configuration in the local AF Server list
The Set-AFServer cmdlet will set an AF Server in the local AF Server list.
Inheritance Hierarchy
InternalCommand
Cmdlet
PSCmdlet
OSIsoft.PowerShellOSICmdletBase
OSIsoft.PowerShellSetAFServer
Namespace: OSIsoft.PowerShell
Assembly: OSIsoft.PowerShell (in OSIsoft.PowerShell.dll) Version: 2.2.3.0 (2.2.3.952)
Syntax
[CmdletAttribute("Set", "AFServer", SupportsShouldProcess = true)] public class SetAFServer : OSICmdletBase
<CmdletAttribute("Set", "AFServer", SupportsShouldProcess := true)> Public Class SetAFServer Inherits OSICmdletBase Dim instance As SetAFServer
[CmdletAttribute(L"Set", L"AFServer", SupportsShouldProcess = true)] public ref class SetAFServer : public OSICmdletBase
[<CmdletAttribute("Set", "AFServer", SupportsShouldProcess = true)>] type SetAFServer = class inherit OSICmdletBase end
The SetAFServer type exposes the following members.
Constructors
| Name | Description | |
|---|---|---|
| SetAFServer |
Properties
| Name | Description | |
|---|---|---|
| Account | Service account name that the AF Server is executing under | |
| AFServer | AFServer object to edit | |
| DefaultPIServerName | Name of the Default PIServer Machine | |
| Description | Description of the AF Server | |
| NewName | NewName of the AF Server | |
| PassThru | Returns objects that were changed. By default, this cmdlet does not generate any output. | |
| Path | Network path of the AF Server. This is the path used when attempting a connection to the AF Server. Note that the network path can be a machine name, IP address, or Fully Qualified Domain Name (FQDN). | |
| Port | TCP port the AF Server is listening on. Typically, this is "5457" | |
| Timeout | Timeout to use when communicating with the AF Server |
Examples
Set-AFServer -Description "New description for Corporate AF Server" -DefaultPIServerName "DEFPISERV" -AFServer (Get-AFServer -Name PIAF1)
This example will edit the description and default PI server of the AF Server PIAF1
Examples
Set-AFServer -NewName NewDefaultServerName -Timeout 00:01:00 -AFServer (Get-AFServer -Default)
This example will rename the default AF Server in the local AF Server list. This should not be confused with renaming the AF Server machine or changing the network path to the AF Server. See the next example to change the network path for an existing AF Server entry in the local AF Servers list.
This example also sets the communication timeout to 1 minute for the default server.
Examples
Set-AFServer -Path PIAF1.example.int (Get-AFServer -Name PIAF1)This example will set the network path for the AF Server PIAF1 to be a Fully Qualified Domain Name (FQDN). Note that the network path can be a hostname, IP address, or Fully Qualified Domain Name (FQDN).