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

PI Powershell

AddAFSecurity Class

  • Last UpdatedDec 15, 2025
  • 3 minute read
AddAFSecurity Class

Add AF Security to AF objects

The Add-AFSecurity cmdlet adds an AF Security Identity to AF Objects that support security.

Inheritance Hierarchy

SystemObject
  InternalCommand
    Cmdlet
      PSCmdlet
        OSIsoft.PowerShellOSICmdletBase
          OSIsoft.PowerShellAddAFSecurity

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

Syntax

[CmdletAttribute("Add", "AFSecurity", SupportsShouldProcess = true)]
public class AddAFSecurity : OSICmdletBase
<CmdletAttribute("Add", "AFSecurity", SupportsShouldProcess := true)>
Public Class AddAFSecurity
	Inherits OSICmdletBase

Dim instance As AddAFSecurity
[CmdletAttribute(L"Add", L"AFSecurity", SupportsShouldProcess = true)]
public ref class AddAFSecurity : public OSICmdletBase
[<CmdletAttribute("Add", "AFSecurity", SupportsShouldProcess = true)>]
type AddAFSecurity =  
    class
        inherit OSICmdletBase
    end

The AddAFSecurity type exposes the following members.

Constructors

  NameDescription
Public method
AddAFSecurity

Properties

  NameDescription
Public property
AccessRights

Access rights to apply to AF Security

Public property
AFSecurityIdentity

The AF Security Identity for which to add the AF Security

Public property
AFSecurityOperation

The operation used when adding user security rights to AF Objects

Public property
AFServer

AF Server on which to modify the security

Public property
ApplyTo

A list of AF Objects that support AF Security for which to add the AF Security

Public property
DenyRights

Deny rights to apply to AF Security

Examples

Add-AFSecurity -AFSecurityIdentity $afIdentity -ApplyTo $afDB -AFSecurityOperation Replace -AccessRights ReadWrite -AFServer (Get-AFServer -Name PIAF1)

Where:

$afDB = Get-AFDatabase "AFDatabase1" -AFServer (Get-AFServer -Name "PIAF1")

$afIdentity = Get-AFSecurityIdentity -Name Engineers -AFServer (Get-AFServer -Name PIAF1)

Give the AF Security Identity "Engineers" read and write access to the AF Database "AFDatabase1" on the AF Server "PIAF1". The Replace AFSecurity option means this will overwrite any previously configured security for Engineers security identity.

Examples

Add-AFSecurity -AFSecurityIdentity $afIdentity -ApplyTo $afDB -AFSecurityOperation Merge -AccessRights Subscribe -AFServer (Get-AFServer -Name PIAF1)

Where:

$afIdentity = Get-AFSecurityIdentity -Name Engineers -AFServer (Get-AFServer -Name PIAF1)

$afElement = Get-AFElement -Name "Production Line 1" -AFDatabase (Get-AFDatabase -Name "AFDatabase1" -AFServer (Get-AFServer -Name "PIAF1"))

Give the AF Security Identity "Engineers" Subscribe permissions on the AF Element "Production Line 1" on the AF Database "AFDatabase1" on the AF Server "PIAF1". The Merge option is used to merge the security settings already existing on the element, with the security settings to be added.

See Also

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