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

PI Powershell

SetPIDatabaseSecurity Class

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

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

SystemObject
  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

  NameDescription
Public method
SetPIDatabaseSecurity

Properties

  NameDescription
Public property
ACL

ACL (Access Control List) object of security settings to be set on the PI Database Security entry

Public property
Connection

Connection to a PI Data Archive for which to set the PI Database Security entry

(Overrides OSICmdletBaseWithConnectionConnection.)
Public property
Name

Name of the PI Database Security entry to set

Public property
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 $con

Where:

$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.

See Also

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