Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,9 @@ Requires:

This software is open sourced by Ping Identity but not supported commercially as such. Any questions/issues should go to the Github issues tracker or discuss on the [Ping Identity developer communities] . See also the DISCLAIMER file in this directory.

### Comments
The Get-PingID-Reports.ps1 is best copied into the ./scripts folder and then run from that locations.
The script contains multiple references to files local to ./scripts folder

[Ping Identity developer communities]: https://community.pingidentity.com/collaborate
[Ping Identity Developer Site]: https://developer.pingidentity.com/connect
7 changes: 5 additions & 2 deletions scripts/Activate-User.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ param(


# Create the API request and parse the results.
$apiEndpoint = "https://idpxnyl3m.pingidentity.com/pingid/rest/4/activateuser/do"
#$apiEndpoint = "https://idpxnyl3m.pingidentity.com/pingid/rest/4/activateuser/do"
$apiEndpoint = $($localPingID +"activateuser/do")

$reqBody = @{
"userName" = $UserName
Expand All @@ -43,7 +44,9 @@ $responsePayload = Call-PingID-API $reqBody $apiEndpoint


# Retrieve the User Details to verify call
$userDetailsEndpoint = "https://idpxnyl3m.pingidentity.com/pingid/rest/4/getuserdetails/do"
#$userDetailsEndpoint = "https://idpxnyl3m.pingidentity.com/pingid/rest/4/getuserdetails/do"
$userDetailsEndpoint = $($localPingID +"getuserdetails/do")

$userDetailsBody = @{
"userName" = $UserName
"getSameDeviceUsers" = $false
Expand Down
9 changes: 6 additions & 3 deletions scripts/Add-User.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,14 @@ param(
[string]$Role = "REGULAR"
)


# Import PingID API helper functions
. .\pingid-api-helper.ps1


# Create the API request and parse the results.
$apiEndpoint = "https://idpxnyl3m.pingidentity.com/pingid/rest/4/adduser/do"
#$apiEndpoint = "https://idpxnyl3m.pingidentity.com/pingid/rest/4/adduser/do"
#$apiEndpoint = "https://idpxnyl3m.pingidentity.eu/pingid/rest/4/adduser/do"
$apiEndpoint = $($localPingID +"adduser/do")

$reqBody = @{
"userName" = $UserName
Expand All @@ -76,7 +77,9 @@ $responsePayload = Call-PingID-API $reqBody $apiEndpoint


# Retrieve the User Details to verify call
$userDetailsEndpoint = "https://idpxnyl3m.pingidentity.com/pingid/rest/4/getuserdetails/do"
#$userDetailsEndpoint = "https://idpxnyl3m.pingidentity.com/pingid/rest/4/getuserdetails/do"
$userDetailsEndpoint = $($localPingID +"getuserdetails/do")

$userDetailsBody = @{
"userName" = $UserName
"getSameDeviceUsers" = $false
Expand Down
4 changes: 3 additions & 1 deletion scripts/Create-Job.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ param(


# Create the API request and parse the results.
$createJobEndpoint = "https://idpxnyl3m.pingidentity.com/pingid/rest/4/createjob/do"
#$createJobEndpoint = "https://idpxnyl3m.pingidentity.com/pingid/rest/4/createjob/do"
$createJobEndpoint = $($localPingID +"createjob/do")

$createJobBody = @{
"jobType" = $JobType
}
Expand Down
6 changes: 4 additions & 2 deletions scripts/Delete-User.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ param(


# Create the API request and parse the results.
$apiEndpoint = "https://idpxnyl3m.pingidentity.com/pingid/rest/4/deleteuser/do"
#$apiEndpoint = "https://idpxnyl3m.pingidentity.com/pingid/rest/4/deleteuser/do"
$apiEndpoint = $($localPingID +"deleteuser/do")

$reqBody = @{
"userName" = $UserName
Expand All @@ -43,7 +44,8 @@ $responsePayload = Call-PingID-API $reqBody $apiEndpoint


# Retrieve the User Details to verify call
$userDetailsEndpoint = "https://idpxnyl3m.pingidentity.com/pingid/rest/4/getuserdetails/do"
#$userDetailsEndpoint = "https://idpxnyl3m.pingidentity.com/pingid/rest/4/getuserdetails/do"
$userDetailsEndpoint = $($localPingID +"getuserdetails/do")
$userDetailsBody = @{
"userName" = $UserName
"getSameDeviceUsers" = $false
Expand Down
5 changes: 4 additions & 1 deletion scripts/Do-Offline-Pairing.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ param(


# Create the API request and parse the results.
$apiEndpoint = "https://idpxnyl3m.pingidentity.com/pingid/rest/4/offlinepairing/do"
#$apiEndpoint = "https://idpxnyl3m.pingidentity.com/pingid/rest/4/offlinepairing/do"
$apiEndpoint = $($localPingID +"offlinepairing/do")



$reqBody = @{
"username" = $UserName
Expand Down
6 changes: 4 additions & 2 deletions scripts/Edit-User.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ param(


# Create the API request and parse the results.
$apiEndpoint = "https://idpxnyl3m.pingidentity.com/pingid/rest/4/edituser/do"
#$apiEndpoint = "https://idpxnyl3m.pingidentity.com/pingid/rest/4/edituser/do"
$apiEndpoint = $($localPingID +"edituser/do")

$reqBody = @{
"userName" = $UserName
Expand All @@ -76,7 +77,8 @@ $responsePayload = Call-PingID-API $reqBody $apiEndpoint


# Retrieve the User Details to verify call
$userDetailsEndpoint = "https://idpxnyl3m.pingidentity.com/pingid/rest/4/getuserdetails/do"
#$userDetailsEndpoint = "https://idpxnyl3m.pingidentity.com/pingid/rest/4/getuserdetails/do"
$userDetailsEndpoint = $($localPingID +"getuserdetails/do")
$userDetailsBody = @{
"userName" = $UserName
"getSameDeviceUsers" = $false
Expand Down
3 changes: 2 additions & 1 deletion scripts/Finalize-Offline-Pairing.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ param(


# Create the API request and parse the results.
$apiEndpoint = "https://idpxnyl3m.pingidentity.com/pingid/rest/4/finalizeofflinepairing/do"
#$apiEndpoint = "https://idpxnyl3m.pingidentity.com/pingid/rest/4/finalizeofflinepairing/do"
$apiEndpoint = $($localPingID +"finalizeofflinepairing/do")

$reqBody = @{
"sessionId" = $SessionId
Expand Down
3 changes: 2 additions & 1 deletion scripts/Get-Activation-Code.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ param(


# Create the API request and parse the results.
$apiEndpoint = "https://idpxnyl3m.pingidentity.com/pingid/rest/4/getactivationcode/do"
#$apiEndpoint = "https://idpxnyl3m.pingidentity.com/pingid/rest/4/getactivationcode/do"
$apiEndpoint = $($localPingID +"getactivationcode/do")

$reqBody = @{
"userName" = $UserName
Expand Down
4 changes: 3 additions & 1 deletion scripts/Get-Job-Status.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ param(


# Create the API request and parse the results.
$getJobStatusEndpoint = "https://idpxnyl3m.pingidentity.com/pingid/rest/4/getjobstatus/do"
#$getJobStatusEndpoint = "https://idpxnyl3m.pingidentity.com/pingid/rest/4/getjobstatus/do"
$getJobStatusEndpoint = $($localPingID +"getjobstatus/do")

$getJobStatusBody = @{
"jobToken" = $JobToken
}
Expand Down
3 changes: 2 additions & 1 deletion scripts/Get-Organization-Report.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ param(


# Create the API request and parse the results.
$orgReportEndpoint = "https://idpxnyl3m.pingidentity.com/pingid/rest/4/getorgreport/do"
#$orgReportEndpoint = "https://idpxnyl3m.pingidentity.com/pingid/rest/4/getorgreport/do"
$orgReportEndpoint = $($localPingID +"getorgreport/do")
$orgReportBody = @{
"fileType" = $FileType
}
Expand Down
3 changes: 2 additions & 1 deletion scripts/Get-Pairing-Status.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ param(


# Create the API request and parse the results.
$apiEndpoint = "https://idpxnyl3m.pingidentity.com/pingid/rest/4/pairingstatus/do"
#$apiEndpoint = "https://idpxnyl3m.pingidentity.com/pingid/rest/4/pairingstatus/do"
$apiEndpoint = $($localPingID +"pairingstatus/do")

$reqBody = @{
"activationCode" = $ActivationCode
Expand Down
4 changes: 3 additions & 1 deletion scripts/Get-User-Details.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ param(


# Create the API request and parse the results.
$userDetailsEndpoint = "https://idpxnyl3m.pingidentity.com/pingid/rest/4/getuserdetails/do"
#$userDetailsEndpoint = "https://idpxnyl3m.pingidentity.com/pingid/rest/4/getuserdetails/do"
$userDetailsEndpoint = $($localPingID +"getuserdetails/do")

$userDetailsBody = @{
"userName" = $UserName
"getSameDeviceUsers" = $false
Expand Down
6 changes: 4 additions & 2 deletions scripts/Pair-YubiKey.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ param(


# Create the API request and parse the results.
$apiEndpoint = "https://idpxnyl3m.pingidentity.com/pingid/rest/4/pairyubikey/do"
#$apiEndpoint = "https://idpxnyl3m.pingidentity.com/pingid/rest/4/pairyubikey/do"
$apiEndpoint = $($localPingID +"pairyubikey/do")

$reqBody = @{
"username" = $UserName
Expand All @@ -49,7 +50,8 @@ $reqBody = @{
$responsePayload = Call-PingID-API $reqBody $apiEndpoint

# Retrieve the User Details to verify call
$userDetailsEndpoint = "https://idpxnyl3m.pingidentity.com/pingid/rest/4/getuserdetails/do"
#$userDetailsEndpoint = "https://idpxnyl3m.pingidentity.com/pingid/rest/4/getuserdetails/do"
$userDetailsEndpoint = $($localPingID +"getuserdetails/do")
$userDetailsBody = @{
"userName" = $UserName
"getSameDeviceUsers" = $false
Expand Down
3 changes: 2 additions & 1 deletion scripts/Start-Offline-Pairing.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ param(


# Create the API request and parse the results.
$apiEndpoint = "https://idpxnyl3m.pingidentity.com/pingid/rest/4/startofflinepairing/do"
#$apiEndpoint = "https://idpxnyl3m.pingidentity.com/pingid/rest/4/startofflinepairing/do"
$apiEndpoint = $($localPingID +"startofflinepairing/do")

$reqBody = @{
"username" = $UserName
Expand Down
6 changes: 4 additions & 2 deletions scripts/Suspend-User.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ param(


# Create the API request and parse the results.
$apiEndpoint = "https://idpxnyl3m.pingidentity.com/pingid/rest/4/suspenduser/do"
#$apiEndpoint = "https://idpxnyl3m.pingidentity.com/pingid/rest/4/suspenduser/do"
$apiEndpoint = $($localPingID +"suspenduser/do")

$reqBody = @{
"userName" = $UserName
Expand All @@ -43,7 +44,8 @@ $responsePayload = Call-PingID-API $reqBody $apiEndpoint


# Retrieve the User Details to verify call
$userDetailsEndpoint = "https://idpxnyl3m.pingidentity.com/pingid/rest/4/getuserdetails/do"
#$userDetailsEndpoint = "https://idpxnyl3m.pingidentity.com/pingid/rest/4/getuserdetails/do"
$userDetailsEndpoint = $($localPingID +"getuserdetails/do")
$userDetailsBody = @{
"userName" = $UserName
"getSameDeviceUsers" = $false
Expand Down
8 changes: 5 additions & 3 deletions scripts/Toggle-User-Bypass.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,14 @@ param(
[int]$Minutes = 0
)


# Import PingID API helper functions
. .\pingid-api-helper.ps1


# Create the API request and parse the results.
$apiEndpoint = "https://idpxnyl3m.pingidentity.com/pingid/rest/4/userbypass/do"
#$apiEndpoint = "https://idpxnyl3m.pingidentity.com/pingid/rest/4/userbypass/do"
$apiEndpoint = $($localPingID +"userbypass/do")

$secondsToBypass = ($Minutes * 60) + ($Hours * 3600) + ($Days * 86400)

if ($secondsToBypass -eq 0) {
Expand All @@ -70,7 +71,8 @@ $responsePayload = Call-PingID-API $reqBody $apiEndpoint


# Retrieve the User Details to verify call
$userDetailsEndpoint = "https://idpxnyl3m.pingidentity.com/pingid/rest/4/getuserdetails/do"
#$userDetailsEndpoint = "https://idpxnyl3m.pingidentity.com/pingid/rest/4/getuserdetails/do"
$userDetailsEndpoint = $($localPingID +"getuserdetails/do")
$userDetailsBody = @{
"userName" = $UserName
"getSameDeviceUsers" = $false
Expand Down
7 changes: 5 additions & 2 deletions scripts/Unpair-Device.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ param(


# Create the API request and parse the results.
$apiEndpoint = "https://idpxnyl3m.pingidentity.com/pingid/rest/4/unpairdevice/do"
#$apiEndpoint = "https://idpxnyl3m.pingidentity.com/pingid/rest/4/unpairdevice/do"
$apiEndpoint = $($localPingID +"unpairdevice/do")

$reqBody = @{
"userName" = $UserName
Expand All @@ -47,5 +48,7 @@ $reqBody = @{
"userName" = $UserName
"getSameDeviceUsers" = $false
}
$responsePayload = Call-PingID-API $reqBody "https://idpxnyl3m.pingidentity.com/pingid/rest/4/getuserdetails/do"
$userDetailsEndpoint = $($localPingID +"getuserdetails/do")
$responsePayload = Call-PingID-API $reqBody $userDetailsEndpoint

Write-Output $responsePayload
24 changes: 20 additions & 4 deletions scripts/pingid-api-helper.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,25 @@
# Replace with the PingID settings found in the PingID settings file:
# Note: Remove any backslash characters from the use_base64_key value.

$org_alias = "<< orgAlias value from pingid.properties file >>";
$use_base64_key = "<< use_base64_key value from pingid.properties file >>";
$token = "<< token value from pingid.properties file >>";
#$localRegion = "eu"
$localRegion = "com"

if ($localRegion -eq "com") {
# -- US Region--
$org_alias = "US-Org-Alias";
$use_base64_key = "US-base64-key";
$token = "US-token-value";
} elseIf ($localRegion -eq "eu"){
# -- EU Region --
$org_alias = "EU-Org-Alias";
$use_base64_key = "EU-base64-key";
$token = "EU-token-value";
}

#$localPingID = "https://idpxnyl3m.pingidentity.eu/pingid/rest/4/"
#$localPingID = "https://idpxnyl3m.pingidentity.com/pingid/rest/4/"
$localPingID = $("https://idpxnyl3m.pingidentity." + $localRegion + "/pingid/rest/4/")
$logLocation = "C:\media\Ping\logs"
$api_version = "4.9"

function Convert-StringToByteArray {
Expand Down Expand Up @@ -151,7 +167,7 @@ function Call-PingID-API {
try {
if ($apiEndpoint -eq "https://idpxnyl3m.pingidentity.com/pingid/rest/4/getorgreport/do") {
$logTimeStamp = Get-Date -f yyyyMMddHHmmss
$apiResponse = Invoke-WebRequest -Uri $apiEndpoint -Body $apiToken -ContentType "application/json" -Method Post -Outfile E:\pingid-users\pingid-$logTimeStamp.$fileType
$apiResponse = Invoke-WebRequest -Uri $apiEndpoint -Body $apiToken -ContentType "application/json" -Method Post -Outfile $($logLocation + "\pingid-$logTimeStamp.$fileType")
} else {
$apiResponse = Invoke-WebRequest -Uri $apiEndpoint -Body $apiToken -ContentType "application/json" -Method Post
}
Expand Down