Skip to content

Instantly share code, notes, and snippets.

Darren Robinson darrenjrobinson

Block or report user

Report or block darrenjrobinson

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Create New Access Profile.ps1
$orgName = "myOrg"
$sourceID = "39012"
$profileOwnerID = "12345"
# Access Profile Details
$accessProfile = @{}
$accessProfile.add("name", "My new Access Profile")
$accessProfile.add("description", "The New AP")
$accessProfile.add("sourceId", $sourceID)
$accessProfile.add("ownerId", $ownerID)
View Get Source Entitlements.ps1
# IdentityNow Orgname
$orgName = "myOrgname"
# Get IdentityNow Sources
$IDNSources = Invoke-RestMethod -Method Get -Uri "https://$($orgName)" -Headers @{Authorization = "Basic $($encodedAuth)" ;"content-type" = "application/json"}
write-host -ForegroundColor Green "$($IDNSources.Count) Sources found"
$utime = [int][double]::Parse((Get-Date -UFormat %s))
# Get Source Entitlements
foreach ($idnSource in $IDNSources) {
View IdenityNow Account ID.ps1
# IdentityNow Organisation
$org = "myOrgname"
# Search Identities
$searchBaseURI = "https://$($org)"
$utime = [int][double]::Parse((Get-Date -UFormat %s))
$userSearch = ""
$userSearchEncoded = [System.Web.HttpUtility]::UrlEncode($userSearch)
View IdentityNow Request Object.json
"joinOperator": "OR",
"filter": [
"property": "name",
"value": ""
"property": "alias",
"value": ""
View Update-Access-Profile.ps1
# IdentityNow Orgname
$orgname = "yourOrgName"
# Update Profile
$UpdateProfilesListBaseURI = "https://$($orgName)"
# Access Profile ID
$profileid = $ # where $profile is an Access Profile retrieved from Get Access Profiles
$updateAccessProfile = @{}
$updateAccessProfile.Add("requestCommentsRequired", $false)
$updateAccessProfile.Add("deniedCommentsRequired", $false)
View Get-Access-Profiles.ps1
# IdentityNow Orgname
$orgname = "yourOrg"
# Access Profiles
$GetProfilesListBaseURI = "https://$($orgName)"
# Update Profile
$UpdateProfilesListBaseURI = "https://$($orgName)"
# Get Profile Entitlements
$GetProfileEntitlementsBaseURI = "https://$($orgName)"
# Existing Profiles
View Search Azure Table Storage.ps1
$storageAccountName = "myStorageAccount"
$storageAccountkey = "abcdefghi123456789YUoxr5mqAmTRgeXSh6Vvx6q+O6aiV9pMaCYbrUo1x/Abcdeb=="
$tableName = "NICVendors"
$apiVersion = "2017-04-17"
$tableURL = "https://$($storageAccountName)$($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
Select-AzureRmSubscription -SubscriptionName $subscriptionName
View Get Network Interface Card Vendors.ps1
# Get MAC Vendor List
$uri = ""
$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
darrenjrobinson / Get AAD auditLogs-directoryAudits events.ps1
Last active Dec 20, 2018
Get Azure Active Directory auditLogs/directoryAudits events using PowerShell and oAuth. Associated blog post
View Get AAD auditLogs-directoryAudits events.ps1
#Sample oAuth 2.0 Microsoft API Powershell AuthN/AuthZ Script
#The resource URI
$resource = ""
#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 = "AuditLog.Read.All;Directory.Read.All"
You can’t perform that action at this time.