Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
1 ACCEPTED SOLUTION
migration has accepted the solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
2 REPLIES 2
migration has accepted the solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
thanks ver ymuch !
