Im trying to use the password credentials tool, within Sapien Powershell Studio. My goal is to replace the clear text password with encrypted password in my scripts, therefore im using the $SAPIENHost.GetPassword(index) to obtain a SecureString object containing password.
But its doesn’t work, firstly when im typing $SAPIENHost powershell studio doesn’t recognize it.
Secondly I receive errors that the user name and the password aren’t recognizable.
This is how im embedding the $SAPIENHost.GetPassword(index) :
set-PowerCLIConfiguration -Scope User -ParticipateInCEIP $true -Confirm:$false
set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false
$VcPassword = $SAPIENHost.GetPassword(0)
$SecurdVcPassword = ConvertTo-SecureString $VcPassword -AsPlainText -Force
$VcCred = New-Object System.Management.Automation.PSCredential ('system_task@www.jerudom1.co.il', $SecurdVcPassword)
Connect-VIServer -Server $script:seclectvc -Credential $VcCred
Thank you in advance
Trouble with embedding secured password
Forum rules
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
-
- Posts: 1
- Last visit: Wed Jan 31, 2024 3:23 am
Re: Trouble with embedding secured password
Can you confirm if $SAPIENHost.GetPassword(0) is returning anything? You could check with a break point on that line or an output statement.
Brittney
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.