Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save darrenjrobinson/57e656b28d83f7d9eb310c871f29531d to your computer and use it in GitHub Desktop.
Save darrenjrobinson/57e656b28d83f7d9eb310c871f29531d to your computer and use it in GitHub Desktop.
Build a Collection of IdentityNow Roles, Entitlements and Access Profiles for inclusion in a Campaign. Supporting Blog Post can be found here https://blog.darrenjrobinson.com/creating-sailpoint-identitynow-certification-campaigns-using-powershell/
# Campaign Inclusions from Identity Results
# Access Profiles, Roles and Entitlments
$inclusionList = @()
# ROLES
foreach ($role in $roles) {
$InclusionTemplate = [pscustomobject][ordered]@{
id = $role
type = "ROLE"
}
$inclusionList += $InclusionTemplate
}
# ENTITLEMENTS
foreach ($entitlement in $entitlements) {
$InclusionTemplate = [pscustomobject][ordered]@{
id = $entitlement
type = "ENTITLEMENT"
}
$inclusionList += $InclusionTemplate
}
# ACCESS PROFILES
foreach ($accessProfile in $accessProfiles) {
$InclusionTemplate = [pscustomobject][ordered]@{
id = $accessProfile
type = "ACCESS_PROFILE"
}
$inclusionList += $InclusionTemplate
}
$e = $inclusionList | select-object -Property type | Where-Object {$_.type -eq "ENTITLEMENT"}
$a = $inclusionList | select-object -Property type | Where-Object {$_.type -eq "ACCESS_PROFILE"}
$r = $inclusionList | select-object -Property type | Where-Object {$_.type -eq "ROLE"}
write-host -ForegroundColor Blue "Campaign scope covers $($r.type.count) Role(s), $($e.type.count) Entitlement(s) and $($a.type.count) Access Profile(s)."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment