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 schema.ps1
# Azure MFA API Schema
$obj = New-Object -Type PSCustomObject
$obj | Add-Member -Type NoteProperty -Name "Anchor-ID|String" -Value "f2ceedf9-888f-4313-bf97-2326f066abc3"
$obj | Add-Member -Type NoteProperty -Name "objectClass|String" -Value "mfaUser"
$obj | Add-Member -Type NoteProperty -Name "userPrincipalName|string" -Value "string"
$obj | Add-Member -Type NoteProperty -Name "isMfaRegistered|boolean" -Value $true
$obj | Add-Member -Type NoteProperty -Name "isRegistered|boolean" -Value $true
$obj | Add-Member -Type NoteProperty -Name "authMethods|string[]" -Value ("string","string")
$obj | Add-Member -Type NoteProperty -Name "isEnabled|boolean" -Value $true
$obj | Add-Member -Type NoteProperty -Name "isCapable|boolean" -Value $true
View import.ps1
param (
$Username,
$Password,
$OperationType,
[bool] $usepagedimport,
$pagesize,
$Credentials
)
$DebugFilePath = "C:\Program Files\Microsoft Forefront Identity Manager\2010\Synchronization Service\Extensions\AzureMFA\Debug\mfaUsersImport.txt"
@darrenjrobinson
darrenjrobinson / Decode Azure JWT Token.ps1
Created Jul 18, 2019
Decode an Azure JWT Token and find expiry time in local timezone
View Decode Azure JWT Token.ps1
function Parse-JWTtoken {
[cmdletbinding()]
param([Parameter(Mandatory = $true)][string]$token)
#Validate as per https://tools.ietf.org/html/rfc7519
#Access and ID tokens are fine, Refresh tokens will not work
if (!$token.Contains(".") -or !$token.StartsWith("eyJ")) { Write-Error "Invalid token" -ErrorAction Stop }
#Header
$tokenheader = $token.Split(".")[0].Replace('-', '+').Replace('_', '/')
@darrenjrobinson
darrenjrobinson / MIMBackup.ps1
Last active Aug 13, 2019
Export and document MIM Configuration, generate Static WebPage with MIM Export and Config. Associated blogpost https://blog.darrenjrobinson.com/automated-microsoft-identity-manager-configuration-backups-documentation-to-azure/
View MIMBackup.ps1
# Import LithnetMIISAutomation for MIM Sync Server Config Exports
Import-Module lithnetmiisautomation
# Find the MA's
$managementagents = Get-ManagementAgent
write-host -ForegroundColor green "$($managementagents.Count) management agents found"
# Local Backup Path
$BackupPath = "G:\Backup"
$foldername = Get-Date -format dd-MM-yyyy-hh-mm
$outputfilepath = "$BackupPath\$foldername"
View Send-PushNotification.ps1
# My Push Bullet Access Token
# Created via Profile Page https://www.pushbullet.com/#settings/account
$pbAccessToken = 'yourPushBulletAccessToken'
# Push Bullet API URI
$pbApiURI = "https://api.pushbullet.com/"
# Web Request Header
$pbHeader = @{"Access-Token" = $pbAccessToken
'Content-Type' = "application/json"
}
View who is home and away.ps1
# Clients to Monitor
$uInterestingClients = @()
$uInterestingClients += "myPhone"
$uInterestingClients += "otherPhone"
$uInterestingClients += "anotherPhone"
# Unifi Controller Login Base URI
$uController = 'yourControllerIP' # e.g 'https://192.168.1.2:8443'
# Identifier of the site in UniFi. Set to Default to use the default site
$uSiteID = "default"
@darrenjrobinson
darrenjrobinson / Get-Unifi-Details.ps1
Last active Jul 15, 2019
PowerShell Script to get Ubiquiti Unifi Sites, Devices and Active Clients. Associated blogpost https://blog.darrenjrobinson.com/accessing-your-ubiquiti-unifi-network-configuration-with-powershell/
View Get-Unifi-Details.ps1
# Unifi Controller Login Base URI
$uController = 'yourControllerIP' # e.g 'https://192.168.1.2:8443'
# Identifier of the site in UniFi. Set to default for the default site
$uSiteID = "default"
$uUsername = 'adminuser' # yourAdmin UserID
$uPassword = 'yourPassword' # yourAdmin User Password
$uAuthBody = @{"username" = $uUsername; "password" = $uPassword }
$uHeaders = @{"Content-Type" = "application/json" }
View import.ps1
param (
$Username,
$Password,
$OperationType,
[bool] $usepagedimport,
$pagesize,
$Credentials
)
$DebugFilePath = "C:\Program Files\Microsoft Forefront Identity Manager\2010\Synchronization Service\Extensions\RACF\Debug\racfUsersImport.txt"
View schema.ps1
# RACF Minimal Schema to support a Join Rule
$obj = New-Object -Type PSCustomObject
$obj | Add-Member -Type NoteProperty -Name "Anchor-racfID|String" -Value ""
$obj | Add-Member -Type NoteProperty -Name "objectClass|String" -Value "racfUser"
$obj
View connect to zOS.ps1
# wc3270 HTTPD Config from wc3270 Start Options e.g. wc3270 A:mainframe.customer.com.au -httpd 127.0.0.1:6001
$wc3270HTTPDHost = "127.0.0.1" # e.g FQDN of host running it, or localhost DNS Name or IP
$wc3270HTTPDPort = "6001" # HTTPD Port
$racfHost = "zoshost.customer.com.au" # z/OS Host
$racfUserID = "ADMINUserName" # RACF UserID
$racfUserPassword = "AdminPassword" # RACF Password
$tracelog = "c:\temp\zOStracelog.txt" # TraceLogPath
$wc3270Path = "C:\Program Files\wc3270" # wc3270 Install Path
$wc3270Args = "A:$($racfHost) -httpd $($wc3270HTTPDHost):$($wc3270HTTPDPort) -trace -tracefile `"$($tracelog)`" -utf8"
You can’t perform that action at this time.