-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAIM_CCP_REST.ps1
22 lines (20 loc) · 940 Bytes
/
AIM_CCP_REST.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
function Get-AIMPassword ([string]$PVWA_URL, [string]$AppID, [string]$Safe, [string]$ObjectName) {
# Declaration
$fetchAIMPassword = "${PVWA_URL}/AIMWebService/api/Accounts?AppID=${AppID}&Safe=${Safe}&Folder=Root&Object=${ObjectName}"
# Execution
try {
$response = Invoke-RestMethod -Uri $fetchAIMPassword -Method GET -ContentType "application/json" -ErrorVariable aimResultErr
Return $response.content
}
catch {
Write-Host "StatusCode: " $_.Exception.Response.StatusCode.value__
Write-Host "StatusDescription: " $_.Exception.Response.StatusDescription
Write-Host "Response: " $_.Exception.Message
Return $false
}
}
$password = Get-AIMPassword -PVWA_URL "https://SUSILCEISPASC32" -AppID "Tenable" -Safe "Tenable" -ObjectName "Operating System-StoneXTenableAccounts-FCStone-SA-CA-Nessus_WP"
Write-Host "Your password is: ${password}"
Start-Sleep -s 10