powershell AIM CCP PowerShell示例
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了powershell AIM CCP PowerShell示例相关的知识,希望对你有一定的参考价值。
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://pvwa.cyberark.local" -AppID "ApplicationID" -Safe "SafeName" -ObjectName "ObjectName"
Write-Host "Your password is: ${password}"
以上是关于powershell AIM CCP PowerShell示例的主要内容,如果未能解决你的问题,请参考以下文章
sh AIM CCP REST - Bash示例
sh AIM CCP REST - Korn Shell示例
powershell SOAP示例 - AIM双重帐户
CentOS 7 上面安装PowerShell
PowerShell 添加任务以使用参数运行 PowerShell 脚本
win10 powershell禁止运行脚本解决