Functions/ServerWebServices/Get-PASServer.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
function Get-PASServer {
    <#
.SYNOPSIS
Returns details of the Web Service Server
 
.DESCRIPTION
Returns information on Server.
Returns the name of the Vault configured in the ServerDisplayName configuration parameter
Appears to need Vault administrator rights
 
.EXAMPLE
Get-PASServer
 
Displays CyberArk Server information
 
.LINK
https://pspas.pspete.dev/commands/Get-PASServer
#>

    [CmdletBinding()]
    param(    )

    BEGIN { }#begin

    PROCESS {

        #Create URL for request
        $URI = "$Script:BaseURI/WebServices/PIMServices.svc/Server"

        #send request to web service
        $result = Invoke-PASRestMethod -Uri $URI -Method GET -WebSession $Script:WebSession

        if ($result) {

            $result

        }

    }#process

    END { }#end

}