PSCredential Class

Definition

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

public ref class PSCredential sealed : System::Runtime::Serialization::ISerializable
[System.Serializable]
public sealed class PSCredential : System.Runtime.Serialization.ISerializable
[<System.Serializable>]
type PSCredential = class
    interface ISerializable
Public NotInheritable Class PSCredential
Implements ISerializable
Inheritance
PSCredential
Attributes
Implements

Constructors

Name Description
PSCredential(PSObject)

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

PSCredential(String, SecureString)

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

Properties

Name Description
Empty

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

GetSymmetricEncryptionKeyDelegate

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

Password

User's password.

UserName

User's name.

Methods

Name Description
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.

Operators

Name Description
Explicit(PSCredential to NetworkCredential)

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

Applies to