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

PI Powershell

SetAFServer Class

  • Last UpdatedDec 15, 2025
  • 4 minute read
SetAFServer Class

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

SystemObject
  InternalCommand
    Cmdlet
      PSCmdlet
        OSIsoft.PowerShellOSICmdletBase
          OSIsoft.PowerShellSetAFServer

Namespace:  OSIsoft.PowerShell
Assembly:  OSIsoft.PowerShell (in OSIsoft.PowerShell.dll) Version: 3.1.1.0 (3.1.1.466)

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

  NameDescription
Public method
SetAFServer

Properties

  NameDescription
Public property
Account

Service account name that the AF Server is executing under

Public property
AFServer

AFServer object to edit

Public property
DefaultPIServerName

Name of the Default PIServer Machine

Public property
Description

Description of the AF Server

Public property
NewName

NewName of the AF Server

Public property
PassThru

Returns objects that were changed. By default, this cmdlet does not generate any output.

Public property
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).

Public property
Port

TCP port the AF Server is listening on. Typically, this is "5457"

Public property
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).

See Also

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