Public/Resources/Get-SIADatabaseStrongAccount.ps1
|
function Get-SIADatabaseStrongAccount { <# .SYNOPSIS Retrieves database strong accounts managed by SIA. .DESCRIPTION Lists or retrieves strong accounts used for database target provisioning. CyberArk does not document server-side filter parameters for the list operation, so this cmdlet returns the full list; filter the result with Where-Object. .PARAMETER Id Retrieves a single database strong account by its ID. .EXAMPLE Get-SIADatabaseStrongAccount Lists every database strong account on the tenant. .INPUTS None. .OUTPUTS psSIA.DatabaseStrongAccount .LINK https://api-docs.cyberark.com/secure-infra-access/docs/strong-account-apis-for-sia-databases #> [CmdletBinding(DefaultParameterSetName = 'List')] [OutputType('psSIA.DatabaseStrongAccount')] param( [Parameter(Mandatory, ParameterSetName = 'ById', ValueFromPipelineByPropertyName)] [Alias('strong_account_id')] [string]$Id ) process { if ($PSCmdlet.ParameterSetName -eq 'ById') { Invoke-SIARequest -Method GET -Path "/api/database-strong-accounts/$Id" | ConvertFrom-SIAResponse -TypeName 'psSIA.DatabaseStrongAccount' } else { Invoke-SIARequest -Method GET -Path '/api/database-strong-accounts' | ConvertFrom-SIAResponse -TypeName 'psSIA.DatabaseStrongAccount' } } } |