PSCredential PSCredential PSCredential Class

Definition

Offers a centralized way to manage usernames, passwords, and credentials.

public sealed class PSCredential : System.Runtime.Serialization.ISerializable
type PSCredential = class
    interface ISerializable
Public NotInheritable Class PSCredential
Implements ISerializable
Inheritance
PSCredentialPSCredentialPSCredential
Implements

Constructors

PSCredential(PSObject) PSCredential(PSObject) PSCredential(PSObject)

Initializes a new instance of the PSCredential class with a username and password from PSObject.

PSCredential(String, SecureString) PSCredential(String, SecureString) PSCredential(String, SecureString)

Initializes a new instance of the PSCredential class with a username and password.

Properties

Empty Empty Empty

Gets an empty PSCredential. This is an PSCredential with both UserName and Password initialized to null.

GetSymmetricEncryptionKeyDelegate GetSymmetricEncryptionKeyDelegate GetSymmetricEncryptionKeyDelegate

Gets or sets a delegate which returns the encryption key and initialization vector for symmetric encryption algorithm.

Password Password Password

User's password.

UserName UserName UserName

User's name.

Methods

GetNetworkCredential() GetNetworkCredential() GetNetworkCredential()

Returns an equivalent NetworkCredential object for this PSCredential.

A null is returned if -- current object has not been initialized -- current creds are not compatible with NetworkCredential (such as smart card creds or cert creds)

GetObjectData(SerializationInfo, StreamingContext) GetObjectData(SerializationInfo, StreamingContext) GetObjectData(SerializationInfo, StreamingContext)

GetObjectData

Operators

Explicit(PSCredential to NetworkCredential) Explicit(PSCredential to NetworkCredential) Explicit(PSCredential to NetworkCredential)

Provides an explicit cast to get a NetworkCredential from this PSCredential.

Applies to