SetPIDatabaseSecurity Class
- Last UpdatedDec 15, 2025
- 3 minute read
Set a PI Database Security entry on the PI Data Archive
The Set-PIDatabaseSecurity cmdlet sets the database security settings for a PI Data Archive.
The connection parameter specifies which connection to a PI Data Archive to use.
Inheritance Hierarchy
InternalCommand
Cmdlet
PSCmdlet
OSIsoft.PowerShellOSICmdletBase
OSIsoft.PowerShellOSICmdletBaseWithConnection
OSIsoft.PowerShellSetPIDatabaseSecurity
Namespace: OSIsoft.PowerShell
Assembly: OSIsoft.PowerShell (in OSIsoft.PowerShell.dll) Version: 3.1.1.0 (3.1.1.466)
Syntax
[CmdletAttribute("Set", "PIDatabaseSecurity", SupportsShouldProcess = true)] public class SetPIDatabaseSecurity : OSICmdletBaseWithConnection
<CmdletAttribute("Set", "PIDatabaseSecurity", SupportsShouldProcess := true)> Public Class SetPIDatabaseSecurity Inherits OSICmdletBaseWithConnection Dim instance As SetPIDatabaseSecurity
[CmdletAttribute(L"Set", L"PIDatabaseSecurity", SupportsShouldProcess = true)] public ref class SetPIDatabaseSecurity : public OSICmdletBaseWithConnection
[<CmdletAttribute("Set", "PIDatabaseSecurity", SupportsShouldProcess = true)>] type SetPIDatabaseSecurity = class inherit OSICmdletBaseWithConnection end
The SetPIDatabaseSecurity type exposes the following members.
Constructors
| Name | Description | |
|---|---|---|
| SetPIDatabaseSecurity |
Properties
| Name | Description | |
|---|---|---|
| ACL | ACL (Access Control List) object of security settings to be set on the PI Database Security entry | |
| Connection | Connection to a PI Data Archive for which to set the PI Database Security entry | |
| Name | Name of the PI Database Security entry to set | |
| Security | A security string representing the Access Control List to be set on the PI Database Security entry EX: "piadmin: A(r,w) | piadmins: A(r,w) | PIWorld: A(r)" |
Examples
Set-PIDatabaseSecurity -Name PIMapping -Security "piadmin: A(r,w) | piadmins: A(r,w) | PIAdministrators: A(r,w) | PIWorld: A(r)" -Connection $conWhere:
$con = Connect-PIDataArchive -PIDataArchiveMachineName "PISRV1"
Sets the PI Database Security for the PIPoint table on the "PISRV1" PI Data Archive server.
Examples
Set-PIDatabaseSecurity -Name PIPoint -Security ((Get-PIPoint -Name sinusoid -Attributes datasecurity -Connection $con).Attributes.datasecurity) -Connection $con
Where:
$con = Connect-PIDataArchive -PIDataArchiveMachineName "PISRV1"
Gets the ACL security string from the PI Point Sinusoid's datasecurity attribute, and sets the security string for the PIPoint table database security to be the same value. Note: this example does not demonstrate a security best practice and is not recommended, and is intended only to demonstrate cmdlet usability.