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).api.identitynow.com/cc/api/source/list" -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).api.identitynow.com/cc/api/user/list?"
$utime = [int][double]::Parse((Get-Date -UFormat %s))
$userSearch = "darren.robinson@customer.com.au"
$userSearchEncoded = [System.Web.HttpUtility]::UrlEncode($userSearch)
View IdentityNow Request Object.json
{
"joinOperator": "OR",
"filter": [
{
"property": "name",
"value": "darren.robinson@customer.com.au"
},
{
"property": "alias",
"value": "darren.robinson@customer.com.au"
View Update-Access-Profile.ps1
# IdentityNow Orgname
$orgname = "yourOrgName"
# Update Profile
$UpdateProfilesListBaseURI = "https://$($orgName).api.identitynow.com/v2/access-profiles"
# Access Profile ID
$profileid = $profile.id # 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).api.identitynow.com/v2/access-profiles"
# Update Profile
$UpdateProfilesListBaseURI = "https://$($orgName).api.identitynow.com/v2/access-profiles"
# Get Profile Entitlements
$GetProfileEntitlementsBaseURI = "https://$($orgName).api.identitynow.com/v2/access-profiles"
# Existing Profiles
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
@darrenjrobinson
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 https://blog.darrenjrobinson.com/azure-self-service-password-reset-reporting-using-powershell/
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"
You can’t perform that action at this time.