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

PI Powershell

AddAFSecurityMapping Class

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

Adds an AF Security Mapping to an AF Server

The Add-AFSecurityMapping cmdlet adds an AF Security Mapping to an AF Server.

Inheritance Hierarchy

SystemObject
  InternalCommand
    Cmdlet
      PSCmdlet
        OSIsoft.PowerShellOSICmdletBase
          OSIsoft.PowerShellAddAFSecurityMapping

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

Syntax

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

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

The AddAFSecurityMapping type exposes the following members.

Constructors

  NameDescription
Public method
AddAFSecurityMapping

Properties

  NameDescription
Public property
Account

Account to add to the AF Security Mapping. The parameter can be provided as a string, for example:

"domain\user"

Public property
AFSecurityIdentity

AF Security Identity to apply to the new AF Security Mapping

Public property
AFServer

AF Server for which to add the AF Security Mapping

Public property
CheckIn

Check in changes immediately

Public property
Description

Description for the new AF Security Mapping

Public property
MappingType

Mapping type to use for the AF Security Mapping.

Public property
Name

Name of the AF Security Mapping to add

Public property
RemoteMachineName

The name of the remote machine to be used as context for resolving the Windows Account

Public property
WindowsAccount

Windows Account to add to the AF Security Mapping. The parameter can be provided as a string, for example:

"domain\user"

Examples

Add-AFSecurityMapping -Name TestUserMapping -WindowsAccount "domain\testuser" -AFSecurityIdentity $Engineers -CheckIn -AFServer (Get-AFServer -Name "PIAF1")

Where:

$Engineers = Get-AFSecurityIdentity -Name "Engineers" -Refresh -AFServer (Get-AFServer -Name "PIAF1")

Creates a new AF Security Mapping for the Windows Account "domain\testuser" called "TestUserMapping" and maps him/her to the Engineers AF Security Identity on the AF Server "PIAF1"

Examples

Add-AFSecurityMapping -Name PIAdministrator -WindowsAccount "domain\adminaccount" -AFSecurityIdentity $Administrators -CheckIn -AFServer (Get-AFServer -Name PIAF1)

Where:

$Administrators = Get-AFSecurityIdentity -Name "Administrators" -Refresh -AFServer (Get-AFServer -Name "PIAF1")

Creates a new AF Security Mapping for the Windows Account "domain\adminaccount" called "PIAdministrator" and maps him/her to the Administrators AF Security Identity on the AF Server "PIAF1"

Examples

Add-AFSecurityMapping -Name RoleMapping -Account "domain/name" -MappingType Role -AFSecurityIdentity $Engineers -CheckIn -AFServer (Get-AFServer -Name PIAF1)

Where:

$Engineers = Get-AFSecurityIdentity -Name "Engineers" -Refresh -AFServer (Get-AFServer -Name "PIAF1")

Creates a new AF Security Mapping for the role "domain/name" called "RoleMapping" and maps it to the Engineers AF Security Identity on the AF Server "PIAF1"

Examples

Add-AFSecurityMapping -Name ClientMapping -Account "clientid" -MappingType ClientCredential -AFSecurityIdentity $Engineers -CheckIn -AFServer (Get-AFServer -Name PIAF1)

Where:

$Engineers = Get-AFSecurityIdentity -Name "Engineers" -Refresh -AFServer (Get-AFServer -Name "PIAF1")

Creates a new AF Security Mapping for the client "clientid" called "ClientMapping" and maps it to the Engineers AF Security Identity on the AF Server "PIAF1"

See Also

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