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

AF SDK Reference

AFAdmin Class

  • Last UpdatedNov 18, 2025
  • 5 minute read
AFAdmin Class
The AFAdmin class is used to perform administrative functions with the PI AF Server.

Inheritance Hierarchy

SystemObject
  OSIsoft.AF.DiagnosticsAFAdmin

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

Syntax

public static class AFAdmin
Public NotInheritable Class AFAdmin

You do not need to declare an instance of a static class in order to access its members.
public ref class AFAdmin abstract sealed
[<AbstractClassAttribute>]
[<SealedAttribute>]
type AFAdmin =  class end

The AFAdmin type exposes the following members.

Methods

  NameDescription
Public methodStatic member
AddTrustedProvider
Add the specified trusted provider subject name to the list of trusted providers in the PISystem.
Public methodStatic member
ClearChangeTables
Clears the tables in the PI AF SQL database which record information on changes to the system.
Public methodStatic member
DeleteOrphans
Deletes orphan objects in the PISystem.
Public methodStatic member
EnableExternalDataTables
Enables support for an AFTable to link to an external source.
Public methodStatic member
EnableExternalDataTablesAllowNonImpersonatedUsers
Enables support for an AFTable to link to an external source with non-impersonated users.
Public methodStatic member
EnablePropagationOfTargetDeletion
Enables support for propagating the deletion of targets (elements) to the referencing analyses and notifications.
Public methodStatic member
EnableUomCaseSensitivity
Changes configuration of UOM abbreviations from case insensitive to case sensitive in the PI AF SQL Server database.
Public methodStatic member
GetDiagnostics
Gets diagnostic information from the system.
Public methodStatic member
GetPlugInVerifyLevel
Gets the current level of verification required for an AFPlugIn to be loaded from the server.
Public methodStatic member
GetTrustedProviders
Returns the list of trusted providers in the PISystem.
Public methodStatic member
GetVersion
Converts the string representing a version to a Version object.
Public methodStatic member
RebuildPathCache
Rebuilds the path cache to each element in the PI AF SQL Server database.
Public methodStatic member
Reindex
Rebuild every index in the PI AF SQL Server database.
Public methodStatic member
RemoveTrustedProvider
Remove the specified trusted provider subject name from the list of trusted providers in the PISystem.
Public methodStatic member
ResyncUsers
Updates the usernames in AF.
Public methodStatic member
SetFileOptions
Sets the file options used to validate an AFFile stored in the PISystem.
Public methodStatic member
SetID
Changes the ID for the PISystem to the specified Guid.
Public methodStatic member
SetPlugInVerifyLevel
Configures the level of verification required for an AFPlugIn to be loaded from the server.

Remarks

The methods in this class can be used to perform administrative functions with the PI AF Server. These could be used with PowerShell to script tasks to manage the server. The functionality provided by this class can also be accomplished by using the AFDiag utility.

Use the PISystem.Supports method to check if the PISystem supports the AdminFunctionality feature.

Security note Security Note
Methods in this class require the administrative right to execute. These methods will error on servers before AF 2018 R2 (2.10.5).

Note Notes to Callers
This method, property, or class is not available in the legacy .NET 3.5 version of the SDK.

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

See Also

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