Instantly share code, notes, and snippets.

Darren Robinson darrenjrobinson

View GitHub Profile
View Search Azure Table Storage.ps1
$storageAccountName = "myStorageAccount"
$storageAccountkey = "abcdefghi123456789YUoxr5mqAmTRgeXSh6Vvx6q+O6aiV9pMaCYbrUo1x/Abcdeb=="
$tableName = "NICVendors"
$apiVersion = "2017-04-17"
$tableURL = "https://$($storageAccountName).table.core.windows.net/$($tableName)"
$GMTime = (Get-Date).ToUniversalTime().toString('R')
$string = "$($GMTime)`n/$($storageAccountName)/$($tableName)"
$hmacsha = New-Object System.Security.Cryptography.HMACSHA256
$hmacsha.key = [Convert]::FromBase64String($storageAccountkey)
View Ingest Dataset to Azure Table Storage.ps1
$subscriptionName = "myAzure Subscription"
$resourceGroupName = "myResourceGroup"
$storageAccountName = "myStorageAccount"
$tableName = "NICVendors"
$partitionKey = "Manufacturers" # Partition Key
# Log on to Azure and set the active subscription
Add-AzureRMAccount
Select-AzureRmSubscription -SubscriptionName $subscriptionName
View Get Network Interface Card Vendors.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 Vendors\vendors.txt"
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Invoke-RestMethod -Uri $uri -Method GET -OutFile $output
$vendors = @()
if (test-path -Path $output) {
$vendorlist = Get-Content -Path $output
View Get AAD auditLogs-directoryAudits events.ps1
#Sample oAuth 2.0 Microsoft API Powershell AuthN/AuthZ Script
#The resource URI
$resource = "https://graph.microsoft.com"
#Your Client ID and Client Secret obainted when registering your WebApp
$clientid = "1c29e80e-ec64-43f7-b07a-1234567890"
$clientSecret = "UEy9yEnU6vcCLzdZm+ABCDEFGHIJKLMyjyL2nYQeU="
#Your Reply URL configured when registering your WebApp
$redirectUri = "https://localhost"
#Scope
$scope = "AuditLog.Read.All;Directory.Read.All"
View Requestable SailPoint IdentityNow Roles.ps1
# Orgname
$orgName = "myOrg"
# Roles
$GetRoleListBaseURI = "https://$($orgName).api.identitynow.com/cc/api/role/list"
# Update Role
$UpdateRoleListBaseURI = "https://$($orgName).api.identitynow.com/cc/api/role/update"
# Existing Roles
$existingRoles = Invoke-RestMethod -method Get -uri $GetRoleListBaseURI -WebSession $IDN
View Get my Gists.ps1
# Authenticate
$clientID = 'myGitHubUsername'
# GitHub API Client Secret
$clientSecret = '21c22a9f0ca888373a3077614d0abcdefghijklmnop'
# Basic Auth
$Bytes = [System.Text.Encoding]::utf8.GetBytes("$($clientID):$($clientSecret)")
$encodedAuth = [Convert]::ToBase64String($Bytes)
# Search based on Description
$search = "Import Script"
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 Get all objects on an IdentityNow Source.ps1
#Install-Module psInlineProgress
# Your API Client ID obtained via IDN Admin Portal
$clientID = "zo7GG51uABCDEFwv"
# Your API Client Secret obtained via IDN Admin Portal
$clientSecret = "3Zm123d4sWish3Lva9yCX9DIfmwABCD"
$Bytes = [System.Text.Encoding]::utf8.GetBytes("$($clientID):$($clientSecret)")
$encodedAuth = [Convert]::ToBase64String($Bytes)
# Your IdentityNow Tenant Name
$orgName = 'CompanyX'
# SourceID of the Source to get objects from
View Export Certification Completion Status Reports.ps1
$orgName = "myIDNOrg"
# Get Campaign Base URI
$GetCampaignBaseURI = "https://$($orgName).api.identitynow.com/cc/api/campaign/get"
# Get Reports Base URI
$getReportsBaseURI = "https://$($orgName).api.identitynow.com/cc/api/campaign/getReports"
# Get Completed Campaigns and Reports
$csvStatusReportBaseURI = "https://$($orgName).api.identitynow.com/cc/api/report/get"
# List Campaign Base URI
$GetCampaignBaseURI = "https://$($orgName).api.identitynow.com/cc/api/campaign/list"
# Export Reports from the last x Days
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