Quantcast
Channel: SAPIEN Forums
Viewing all articles
Browse latest Browse all 311

PowerShell • Trouble with embedding secured password

$
0
0

Code:

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

Statistics: Posted by vAdmin-Jerusalem — Wed Jan 31, 2024 3:22 am — Replies 1 — Views 219



Viewing all articles
Browse latest Browse all 311

Trending Articles