functions/configurations/Search-TssPlatformConfigurationAudit.ps1
|
function Search-TssPlatformConfigurationAudit { <# .SYNOPSIS Search the audit records of the Platform integration configuration .DESCRIPTION Returns the audit trail of changes made to the Delinea Platform integration configuration: action, date, user display name and notes. .PARAMETER TssSession TssSession object created by New-TssSession for authentication .EXAMPLE $session = New-TssSession -SecretServer https://alpha -Credential $ssCred Search-TssPlatformConfigurationAudit -TssSession $session Returns the Platform integration configuration audit records .LINK https://thycotic-ps.github.io/thycotic.secretserver/commands/configurations/Search-TssPlatformConfigurationAudit .LINK https://github.com/thycotic-ps/thycotic.secretserver/blob/main/src/functions/configurations/Search-TssPlatformConfigurationAudit.ps1 .NOTES Requires TssSession object returned by New-TssSession #> [CmdletBinding()] [OutputType('Thycotic.PowerShell.Configuration.Audit[]')] param ( [Parameter(Mandatory, ValueFromPipeline, Position = 0)] [Thycotic.PowerShell.Authentication.Session] $TssSession ) begin { $tssParams = $PSBoundParameters $invokeParams = . $GetInvokeApiParams $TssSession } process { Get-TssInvocation $PSCmdlet.MyInvocation if ($tssParams.ContainsKey('TssSession') -and $TssSession.IsValidSession()) { Compare-TssVersion $TssSession '10.9.000000' $PSCmdlet.MyInvocation $uri = $TssSession.ApiUrl, 'configuration', 'platform-audits' -join '/' $queryParams = @() $queryParams += "take=$($TssSession.Take)" if ($queryParams) { $uri = $uri, ($queryParams -join '&') -join '?' } $invokeParams.Uri = $uri $invokeParams.Method = 'GET' Write-Verbose "Performing the operation $($invokeParams.Method) $uri" try { $apiResponse = Invoke-TssApi @invokeParams $restResponse = . $ProcessResponse $apiResponse } catch { Write-Warning 'Issue with Search-TssPlatformConfigurationAudit request' $err = $_ . $ErrorHandling $err } if ($restResponse.records) { [Thycotic.PowerShell.Configuration.Audit[]](. $FilterTssResponse $restResponse.records ([Thycotic.PowerShell.Configuration.Audit])) } } else { Write-Warning 'No valid session found' } } } |