Functions/Applications/Get-PASApplicationAuthenticationMethod.ps1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
function Get-PASApplicationAuthenticationMethod {
    <#
.SYNOPSIS
Returns information about all of the authentication methods of a specific application.
 
.DESCRIPTION
Returns information about all of the authentication methods of a specific application.
The user authenticated to the vault running the command must have the "Audit Users" permission.
 
.PARAMETER AppID
The name of the application for which information about authentication methods will be returned.
 
.EXAMPLE
Get-PASApplicationAuthenticationMethod -AppID NewApp
 
Gets all authentication methods of application NewApp
 
.INPUTS
All parameters can be piped by property name
Should accept pipeline objects from other *-PASApplication* functions
 
.OUTPUTS
Outputs Object of Custom Type psPAS.CyberArk.Vault.Application
Output format is defined via psPAS.Format.ps1xml.
To force all output to be shown, pipe to Select-Object *
 
.LINK
https://pspas.pspete.dev/commands/Get-PASApplicationAuthenticationMethod
#>

    [CmdletBinding()]
    param(
        [parameter(
            Mandatory = $true,
            ValueFromPipelinebyPropertyName = $true
        )]
        [string]$AppID
    )

    BEGIN { }#begin

    PROCESS {

        $URI = "$Script:BaseURI/WebServices/PIMServices.svc/Applications/$($AppID |
 
            Get-EscapedString)/Authentications"


        $result = Invoke-PASRestMethod -Uri $URI -Method GET -WebSession $Script:WebSession

        if ($result) {

            $result.authentication | Add-ObjectDetail -typename psPAS.CyberArk.Vault.ApplicationAuth

        }

    }#process

    END { }#end

}