Instantly share code, notes, and snippets.

View Percentage Complete.ps1
# $idnObjects is a collection of thousands of identities being processed.
# Progress for Burnt
[decimal] $progress = $i / $idnObjects.count
# Percentage for psInlineProgress
$percentComplete = $i / $idnObjects.count * 100
# Round to 3 decimal places so we can update every percent of progress
$progressDisplay = [math]::Round($progress,3)
if ([math]::Floor($percentComplete) -gt $statusupdate) {
$statusupdate = [math]::Floor($percentComplete)
View Create and Activate Manager Certification Campaign for a Source.ps1
# Create Campaign URI
$createCampaignURI = "https://$($orgName).api.identitynow.com/cc/api/campaign/create"
# Get Campaign Base URI
$GetCampaignBaseURI = "https://$($orgName).api.identitynow.com/cc/api/campaign/get"
# Activate Campaign URI
$activateCampaignURI = "https://$($orgName).api.identitynow.com/cc/api/campaign/activate"
# Search Limit. 2500
$searchLimit = '2500'
# Search Identities URI
View Create SailPoint IdentityNow Manager Certification Campaign.ps1
# Create Campaign URI
$createCampaignURI = "https://$($orgName).api.identitynow.com/cc/api/campaign/create"
# Get Campaign Base URI
$GetCampaignBaseURI = "https://$($orgName).api.identitynow.com/cc/api/campaign/get"
# Activate Campaign URI
$activateCampaignURI = "https://$($orgName).api.identitynow.com/cc/api/campaign/activate"
# Create Campaign
$campaignOptions = @{}
$campaignOptions.Add("type", "Identity")
View SailPoint IdentityNow Certification Inclusions.ps1
# 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
View obtain roles entitlements and access profiles.ps1
$roles = @()
$entitlements = @()
$accessProfiles = @()
foreach ($identity in $Accounts) {
write-host ""
Write-host "Details for $($identity.name)"
write-host " $($identity.source.name) : $($identity.displayName)"
foreach ($source in $identity.access) {
View MACAddress Vendor Lookup.ps1
$requestBody = Get-Content $req -Raw | ConvertFrom-Json
$query = $requestBody.query
$query
if ($query)
{
# LOAD MAC Address to Vendors PSObjects
$vendors = Import-Clixml -Path "D:\home\site\wwwroot\YOURAZUREFUNCTION\Vendors.xml"
$output = $null
$response = $null
if ($query.Contains("-")) {
View MAC Address OUI.ps1
# Get MAC Vendor List http://standards.ieee.org/develop/regauth/oui/oui.txt
$uri = "http://standards.ieee.org/develop/regauth/oui/oui.txt"
$output = "C:\temp\MAC Address\vendors.txt"
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Invoke-RestMethod -Uri $uri -Method GET -OutFile $output
$vendors = @()
if (test-path -Path $output) {
View Import.ps1
param (
$Username,
$Password,
$Credentials,
$OperationType,
[bool] $usepagedimport,
$pagesize
)
$DebugFilePath = "C:\PROGRA~1\MICROS~2\2010\SYNCHR~1\EXTENS~2\Workday\Debug\WDUsersImport.txt"
View Schema.ps1
$obj = New-Object -Type PSCustomObject
$obj | Add-Member -Type NoteProperty -Name "Anchor-WorkerWid|String" -Value ""
$obj | Add-Member -Type NoteProperty -Name "objectClass|String" -Value "WDUser"
$obj | Add-Member -Type NoteProperty -Name "BusinessTitle|string" -Value "string"
$obj | Add-Member -Type NoteProperty -Name "FirstName|string" -Value "string"
$obj | Add-Member -Type NoteProperty -Name "JobProfileName|string" -Value "string"
$obj | Add-Member -Type NoteProperty -Name "LastName|string" -Value "string"
$obj | Add-Member -Type NoteProperty -Name "Location|string" -Value "string"
$obj | Add-Member -Type NoteProperty -Name "PreferredName|string" -Value "string"
$obj | Add-Member -Type NoteProperty -Name "UserId|string" -Value "string"
View import.ps1
param (
$Username,
$Password,
$Credentials,
$OperationType,
[bool] $usepagedimport,
$pagesize
)
$DebugFilePath = "C:\PROGRA~1\MICROs~2\2010\SYNCHR~1\EXTENS~2\AzureA~3\Debug\AADImport.txt"