Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Managing SailPoint IdentityNow Sources via API using PowerShell. Associated Blog Post can be found here
# Remove Content-Type otherwise repsonse from IDN Sources API complains about missing ID or Name in request. Go figure.
# Get IdentityNow Sources
$IDNSources = Invoke-RestMethod -Method Get -Uri "https://$($orgName)" -WebSession $IDN
write-host -ForegroundColor Green "$($IDNSources.Count) Sources found"
# Get Source Details
$sourceDetailsURI = "https://$($orgName)"
foreach ($idnSource in $IDNSources) {
$sourceInfo = Invoke-RestMethod -Method Get -uri "$($sourceDetailsURI)/$($" -WebSession $IDN
# Get Source Schema
$sourceSchemaURI = "https://$($orgName)"
foreach ($idnSource in $IDNSources) {
$sourceSchema = Invoke-RestMethod -Uri "$($sourceSchemaURI)/$($" -WebSession $IDN
# Update Source
$sourceUpdateURI = "https://$($orgName)"
# Change Headers
$Global:IDN.Headers.Add('Content-Type', "application/x-www-form-urlencoded; charset=UTF-8")
# Source Attrs to change
$sourceID = "36666"
$sourceDesscription = "CyberArk"
$sourceOwnerID = "1089123"
$sourceDetailsBody = "description=$($sourceDesscription)&ownerId=$($sourceOwnerID)"
$updateSource = Invoke-RestMethod -Method Post -Uri "$($sourceUpdateURI)/$($sourceID)" -Body $sourceDetailsBody -WebSession $IDN
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.