AddAFSecurity Class
- Last UpdatedDec 15, 2025
- 3 minute read
Add AF Security to AF objects
The Add-AFSecurity cmdlet adds an AF Security Identity to AF Objects that support security.
Inheritance Hierarchy
InternalCommand
Cmdlet
PSCmdlet
OSIsoft.PowerShellOSICmdletBase
OSIsoft.PowerShellAddAFSecurity
Namespace: OSIsoft.PowerShell
Assembly: OSIsoft.PowerShell (in OSIsoft.PowerShell.dll) Version: 2.2.3.0 (2.2.3.952)
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
| Name | Description | |
|---|---|---|
| AddAFSecurity |
Properties
| Name | Description | |
|---|---|---|
| AccessRights | Access rights to apply to AF Security | |
| AFSecurityIdentity | The AF Security Identity for which to add the AF Security | |
| AFSecurityOperation | The operation used when adding user security rights to AF Objects | |
| AFServer | AF Server on which to modify the security | |
| ApplyTo | A list of AF Objects that support AF Security for which to add the AF Security | |
| 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.