Active IQ Unified Manager Discussions
Active IQ Unified Manager Discussions
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
Solved! See The Solution
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
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
thanks ver ymuch !