PSPrincipal Class

Definition

Defines the basic functionality of a PSPrincipal object.

C++
public ref class PSPrincipal sealed : System::Security::Principal::IPrincipal
Inheritance
PSPrincipal
Implements

Constructors

PSPrincipal(PSIdentity, WindowsIdentity)

Constructs PSPrincipal using PSIdentity and a WindowsIdentity.

Properties

Identity

Gets the identity of the current user principal.

WindowsIdentity

Gets the WindowsIdentity (if possible) representation of the current Identity. PSPrincipal can represent any user for example a LiveID user, network user within a domain etc. This property tries to convert the Identity to WindowsIdentity using the user token supplied.

Methods

IsInRole(String)

Determines if the current principal belongs to a specified rule. If we were able to get a WindowsIdentity then this will perform the check using the WindowsIdentity otherwise this will return false.

Explicit Interface Implementations

IPrincipal.Identity

Gets the identity of the current principal.

Applies to

Product Versies
PowerShell SDK 7.2.0, 7.3.0, 7.4.0
Windows PowerShell 5.1.0.0