Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Create SailPoint IdentityNow Manager Certification Campaign. Supporting Blog Post can be found here
# Create Campaign URI
$createCampaignURI = "https://$($orgName)"
# Get Campaign Base URI
$GetCampaignBaseURI = "https://$($orgName)"
# Activate Campaign URI
$activateCampaignURI = "https://$($orgName)"
# Create Campaign
$campaignOptions = @{}
$campaignOptions.Add("type", "Identity")
$campaignOptions.Add("timeZone", "GMT+1100")
$campaignOptions.Add("name", "15 Nov 2018 Campaign")
$campaignOptions.Add("allowAutoRevoke", $false)
$campaignOptions.Add("deadline", "2018-11-30")
$campaignOptions.Add("description", "Active Directory Nov 2018")
$campaignOptions.Add("disableEmail", $false)
$campaignOptions.Add("identityIdList", @())
$campaignOptions.Add("identityQueryString", $query)
$campaignOptions.Add("accessInclusionList", $inclusionList)
$campaignBody = $campaignOptions | ConvertTo-Json
If ($campaignBody) {
# Create Campaign
$createResult = Invoke-RestMethod -Method Post -uri $createCampaignURI -Body $campaignBody -WebSession $IDN
start-sleep -Seconds 10
if ($createResult) {
$GetCampaignURI = "$($GetCampaignBaseURI)/$($"
# Get Campaign
$campaignStatus = Invoke-RestMethod -Method Get -Uri $GetCampaignURI -WebSession $IDN
if ($campaignStatus.status.Equals("Staged")) {
try {
# Activate Campaign
$activateBody = "campaignId=$($"
Invoke-RestMethod -Method Post -Uri $activateCampaignURI -Body $activateBody -WebSession $IDN
write-host -ForegroundColor Blue "Campaign $($createResult.description) successfully created and started."
catch {
write-host -ForegroundColor Red "Campaign $($createResult.description) was not successfully started."
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.