AddPIUser Class
- Last UpdatedDec 15, 2025
- 3 minute read
Add a new PI User to a PI Data Archive
The Add-PIUser cmdlet adds a new PI User on a PI Data Archive
The connection parameter specifies which connection to a PI Data Archive to use.
NOTE: PI Users and PI Groups have been replaced by PI Identities. PI Identities with PI Mappings (WIS) and PI Trusts should be used to configure PI Data Archive security. See KB00833 for more information.
Inheritance Hierarchy
InternalCommand
Cmdlet
PSCmdlet
OSIsoft.PowerShellOSICmdletBase
OSIsoft.PowerShellAddPIUser
Namespace: OSIsoft.PowerShell
Assembly: OSIsoft.PowerShell (in OSIsoft.PowerShell.dll) Version: 2.2.3.0 (2.2.3.952)
Syntax
[CmdletAttribute("Add", "PIUser", SupportsShouldProcess = true)] public class AddPIUser : OSICmdletBase
<CmdletAttribute("Add", "PIUser", SupportsShouldProcess := true)> Public Class AddPIUser Inherits OSICmdletBase Dim instance As AddPIUser
[CmdletAttribute(L"Add", L"PIUser", SupportsShouldProcess = true)] public ref class AddPIUser : public OSICmdletBase
[<CmdletAttribute("Add", "PIUser", SupportsShouldProcess = true)>] type AddPIUser = class inherit OSICmdletBase end
The AddPIUser type exposes the following members.
Constructors
| Name | Description | |
|---|---|---|
| AddPIUser |
Properties
| Name | Description | |
|---|---|---|
| Connection | Connection to a PI Data Archive for which to add the PI User | |
| Description | Description for the PI User to add | |
| Name | Name of the PI User to add | |
| Password | Password for the PI User. This is supplied as a SecureString. ConvertTo-SecureString can be used to convert a String to a SecureString. | |
| PIGroups | PI Groups to add the PI User to. Multiple groups can be added in a comma-separated list |
Examples
Add-PIUser -Name "John Doe" -Description "PI User Account for John Doe" -Password (ConvertTo-SecureString -String "examplepassword" -AsPlainText -Force) -PIGroups "PIEngineersGroup","PIReadersGroup" -Connection $con
Where:
$con = Connect-PIDataArchive -PIDataArchiveMachineName "PISRV1"
This example creates a new PI User "John Doe" with a password of "examplepassword" and is added to two PI Groups "PIEngineersGroup" and "PIReadersGroup". A description is also added
Use "Get-Help ConvertTo-SecureString -Full" for more information on ConvertTo-SecureString cmdlet.