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

PI Powershell

SetAFSecurityMapping Class

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

Set an AF Security Mapping on an AF Server

The Set-AFSecurityMapping cmdlet edits an existing AF Security Mapping on an AF Server. This cmdlet can be used to rename, change the description, or map the AF Security Mapping to a new AF Identity.

Inheritance Hierarchy

SystemObject
  InternalCommand
    Cmdlet
      PSCmdlet
        OSIsoft.PowerShellOSICmdletBase
          OSIsoft.PowerShellSetAFSecurityMapping

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

Syntax

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

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

The SetAFSecurityMapping type exposes the following members.

Constructors

  NameDescription
Public method
SetAFSecurityMapping

Properties

  NameDescription
Public property
AFSecurityIdentity

AF Security Identity to set on the AF Security Mapping

Public property
AFSecurityMapping

Existing AF Security Mapping to edit

Public property
CheckIn

Check in changes immediately

Public property
Description

Description to set on the AF Security Mapping

Public property
NewName

New name to set on the AF Security Mapping

Public property
PassThru

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

Examples

Set-AFSecurityMapping -AFSecurityIdentity $Administrators -Description "TestUser now added as administrator" -CheckIn -AFSecurityMapping $TestUser

Where:

$TestUser = Get-AFSecurityMapping -Name "domain\testuser" -Refresh -AFServer (Get-AFServer -Name "PIAF1")

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

This example edits the current mapping for "domain\testuser" and sets his AF Identity to give him "Administrators" permissions. The description is also updated to reflect this change. The change is checked in immediately.

Examples

Set-AFSecurityMapping -NewName "TestUser_Administrator" -CheckIn -AFSecurityMapping $TestUser

Where:

$TestUser = Get-AFSecurityMapping -Name "domain\testuser" -Refresh -AFServer (Get-AFServer -Name "PIAF1")

This example renames the mapping for "domain\testuser" on the "PIAF1" AF Server to "TestUser_Administrator". The change is checked in immediately.

See Also

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