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

PI Powershell

SetPIMapping Class

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

Set a PI Security Mapping

The Set-PIMapping cmdlet edits and existing PI Security Mapping

The connection parameter specifies which connection to a PI Data Archive to use.

Inheritance Hierarchy

SystemObject
  InternalCommand
    Cmdlet
      PSCmdlet
        OSIsoft.PowerShellOSICmdletBase
          OSIsoft.PowerShellOSICmdletBaseWithConnection
            OSIsoft.PowerShellSetPIMapping

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

Syntax

[CmdletAttribute("Set", "PIMapping", SupportsShouldProcess = true)]
public class SetPIMapping : OSICmdletBaseWithConnection
<CmdletAttribute("Set", "PIMapping", SupportsShouldProcess := true)>
Public Class SetPIMapping
	Inherits OSICmdletBaseWithConnection

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

The SetPIMapping type exposes the following members.

Constructors

  NameDescription
Public method
SetPIMapping

Properties

  NameDescription
Public property
Connection

Connection to a PI Data Archive for which to set the PI Mapping

(Overrides OSICmdletBaseWithConnectionConnection.)
Public property
Description

Description for the PI Mapping to add

Public property
Disabled

Mark the PI Mapping to set as disabled

Public property
Identity

PI Identity to assign to the PI Mapping to set

Public property
Name

Name of the PI Mapping to set

Public property
PrincipalName

Principal Name of the PI Mapping to set

Examples

Set-PIMapping -Name "Windows_S-1-5-21-2084324470-1890137325-1469997231-42999" -Disabled $true -Connection $con

Where:

$con = Connect-PIDataArchive -PIDataArchiveMachineName "PISRV1"

Disables the PI Mapping "Windows_S-1-5-21-2084324470-1890137325-1469997231-42999" on the "PISRV1" PI Data Archive server.

Note that name of the mapping is typically Windows_[WindowsSID] where [WindowsSID] is the Windows SID of the Windows User or Group the mapping is for.

Examples

Set-PIMapping -Name "Windows_S-1-5-21-2084324470-1890137325-1469997231-42999" -Identity "piadmins" -Connection $con

Where:

$con = Connect-PIDataArchive -PIDataArchiveMachineName "PISRV1"

Sets the identity for the PI Mapping "Windows_S-1-5-21-2084324470-1890137325-1469997231-42999" to be "piadmins", overwriting whatever the previous identity was set as.

Note: The name of the mapping is typically Windows_[WindowsSID] where [WindowsSID] is the Windows SID of the Windows User or Group the mapping is for.

Note: $true and $false should be used to pass boolean values in PowerShell. However, you can also pass 0 for $false and 1 for $true. However, using the PowerShell boolean values helps improve read-ability.

See Also

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