infamousjoeg
7/17/2017 - 6:35 PM

SOAP Example - AIM Dual Accounts

SOAP Example - AIM Dual Accounts

$proxy = New-WebServiceProxy -Uri https://windev.cyberark.local/aimwebservice/v1.1/aim.asmx?WSDL
$cert= New-Object System.Security.Cryptography.X509Certificates.X509Certificate2("C:\cert\GoodCert.cer")
$t = $proxy.getType().namespace
$proxy.ClientCertificates.Add($cert)
$request = New-Object ($t + ".passwordRequest")
$request.AppID = "DistributedApp";
$request.Query = "VirtualUsername=aimtest";
$response = $proxy.GetPassword($request)
write-host "Username:"
$response.username
write-host "Address:"
$response.address
write-host "Content:"
$response.content
$response.VirtualUsername