Last active
August 9, 2017 02:34
-
-
Save infamousjoeg/6a9f2c54f7c96f2e7d5c169cae5fc90a to your computer and use it in GitHub Desktop.
SOAP Example - AIM Dual Accounts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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