AddPIMapping Class
- Last UpdatedDec 15, 2025
- 4 minute read
Add a PI Security Mapping
The Add-PIMapping cmdlet adds a PI Security Mapping
The connection parameter specifies which connection to a PI Data Archive to use.
Inheritance Hierarchy
InternalCommand
Cmdlet
PSCmdlet
OSIsoft.PowerShellOSICmdletBase
OSIsoft.PowerShellOSICmdletBaseWithConnection
OSIsoft.PowerShellAddPIMapping
Namespace: OSIsoft.PowerShell
Assembly: OSIsoft.PowerShell (in OSIsoft.PowerShell.dll) Version: 3.1.1.0 (3.1.1.466)
Syntax
[CmdletAttribute("Add", "PIMapping", SupportsShouldProcess = true)] public class AddPIMapping : OSICmdletBaseWithConnection
<CmdletAttribute("Add", "PIMapping", SupportsShouldProcess := true)> Public Class AddPIMapping Inherits OSICmdletBaseWithConnection Dim instance As AddPIMapping
[CmdletAttribute(L"Add", L"PIMapping", SupportsShouldProcess = true)] public ref class AddPIMapping : public OSICmdletBaseWithConnection
[<CmdletAttribute("Add", "PIMapping", SupportsShouldProcess = true)>] type AddPIMapping = class inherit OSICmdletBaseWithConnection end
The AddPIMapping type exposes the following members.
Constructors
| Name | Description | |
|---|---|---|
| AddPIMapping |
Properties
| Name | Description | |
|---|---|---|
| Connection | Connection to a PI Data Archive for which to add the PI Mapping | |
| Description | Description for the PI Mapping to add | |
| Disabled | Mark the PI Mapping to add as disabled | |
| Identity | PI Identity to assign to the PI Mapping to add | |
| MappingType | Mapping Type of the PI Mapping to add (defaults to Windows) | |
| Name | Name of the PI Mapping to add | |
| Principal | Principal of the PI Mapping to add |
Examples
Add-PIMapping -Name "TestMapping" -Identity "PIEngineers" -Principal "exampledomain\jdoe" -Description "PI Mapping for John Doe" -Connection $con
Where:
$con = Connect-PIDataArchive -PIDataArchiveMachineName "PISRV1"
Adds the PI Mapping "TestMapping" for John Doe on the "PISRV1" PI Data Archive server. John Doe is mapped to the PIEngineers identity.
Examples
Add-PIMapping -Name "Domain Users Mapping" -Identity "DomainUsersReadOnly" -Principal "exampledomain\domainusers" -Description "Mapping for all domain users" -Disabled -Connection $con
Where:
$con = Connect-PIDataArchive -PIDataArchiveMachineName "PISRV1"
Adds the PI Mapping "Domain Users Mapping" for the windows group "domain\domainusers" on the "PISRV1" PI Data Archive server. Example\domainusers is mapped to a custom PI Identity "DomainUsersReadOnly" and is disabled upon creation. This will allow the mapping to not be effective immediately, and can be enabled later.
Examples
Add-PIMapping -Name "Role Mapping" -Identity "PIEngineers" -MappingType AIMRole -Principal "domain/roleid" -Connection $con
Where:
$con = Connect-PIDataArchive -PIDataArchiveMachineName "PISRV1"
Adds the PI Mapping "Role Mapping" for a role, on the "PISRV1" PI Data Archive server. The role is mapped to the PIEngineers identity.
Examples
Add-PIMapping -Name "Client Mapping" -Identity "PIEngineers" -MappingType ClientCredential -Principal "clientid" -Connection $con
Where:
$con = Connect-PIDataArchive -PIDataArchiveMachineName "PISRV1"
Adds the PI Mapping "Client Mapping" for a client, on the "PISRV1" PI Data Archive server. The client id is mapped to the PIEngineers identity.