Monday 1 January 2018

Encrypted password to login to vCenter in POWERCLI


$Password = Read-Host -Prompt "Enter Password" -AsSecureString
$DecodedPassword = [System.Runtime.InteropServices.Marshal]::PtrToStringAuto([System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($Password))
Connect-VIServer -Server vcsa-a.vclass.local -User administrator@vsphere.local -Password $DecodedPassword




No comments:

Post a Comment