The transition to NetApp MS Azure AD B2C is complete. If you missed the pre-registration, you will be invited to register at next log in.
Please note that access to your NetApp data may take up to 1 hour.
To learn more, read the FAQ and watch the video.
Need assistance? Complete this form and select “Registration Issue” as the Feedback Category.

Active IQ Unified Manager Discussions

using password out of saved credentials

THORSTEN_KRAUSE

Hello,

can you tell me how to get the password out of Get-WfaCredentials return value?

$myCredentials = Get-WfaCredentials -Host "X100X" -ErrorAction stop

Is there a way to do this?

Thanks,

Thorsten

1 ACCEPTED SOLUTION

sinhaa

In the command "Send Email" There is a function defined which can tell you how to do it.

function ConvertFromSecureToPlain{

    param(

        [Parameter(Mandatory=$true)]

        [System.Security.SecureString] $SecurePassword

    )

    # Create a "password pointer"

    $PasswordPointer = [Runtime.InteropServices.Marshal]::SecureStringToBSTR($SecurePassword)

    # Get the plain text version of the password

    $PlainTextPassword = [Runtime.InteropServices.Marshal]::PtrToStringAuto($PasswordPointer)

    # Free the pointer

    [Runtime.InteropServices.Marshal]::ZeroFreeBSTR($PasswordPointer)

    # Return the plain text password

    $PlainTextPassword

}

Call this using something like:

$myPassword =  ConvertFromSecureToPlain -SecurePassword $myCredentials.Password

If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.

View solution in original post

2 REPLIES 2

sinhaa

In the command "Send Email" There is a function defined which can tell you how to do it.

function ConvertFromSecureToPlain{

    param(

        [Parameter(Mandatory=$true)]

        [System.Security.SecureString] $SecurePassword

    )

    # Create a "password pointer"

    $PasswordPointer = [Runtime.InteropServices.Marshal]::SecureStringToBSTR($SecurePassword)

    # Get the plain text version of the password

    $PlainTextPassword = [Runtime.InteropServices.Marshal]::PtrToStringAuto($PasswordPointer)

    # Free the pointer

    [Runtime.InteropServices.Marshal]::ZeroFreeBSTR($PasswordPointer)

    # Return the plain text password

    $PlainTextPassword

}

Call this using something like:

$myPassword =  ConvertFromSecureToPlain -SecurePassword $myCredentials.Password

If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.

View solution in original post

THORSTEN_KRAUSE

thanks ver ymuch !

Announcements
NetApp on Discord Image

We're on Discord, are you?

Live Chat, Watch Parties, and More!

Explore Banner

Meet Explore, NetApp’s digital sales platform

Engage digitally throughout the sales process, from product discovery to configuration, and handle all your post-purchase needs.

NetApp Insights to Action
I2A Banner
Public