Skip to content

Instantly share code, notes, and snippets.

@infamousjoeg
Last active August 9, 2017 02:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save infamousjoeg/6a9f2c54f7c96f2e7d5c169cae5fc90a to your computer and use it in GitHub Desktop.
Save infamousjoeg/6a9f2c54f7c96f2e7d5c169cae5fc90a to your computer and use it in GitHub Desktop.
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment