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 TestMIMADMAPorts.ps1
# Insert Test-Port Function here from https://gallery.technet.microsoft.com/scriptcenter/97119ed6-6fb2-446d-98d8-32d823867131
# UDP Ports to probe
$udpports = @()
$udpports += "464" #Kerberos
$udpports += "3268" #GC
$udpports += "3269" #GC
# TCP Ports to probe
$ports = @()
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" }
@darrenjrobinson
darrenjrobinson / UpdatedNSGSourceIPRDPRuleStartVMandConnect.ps1
Last active Jul 15, 2019
Update an Azure NSG for my current public ip address, start the virtual machine and launch remote desktop to the VM. Associated blogpost https://blog.darrenjrobinson.com/automating-source-ip-address-updates-on-an-azure-network-security-group-rdp-access-rule/
View UpdatedNSGSourceIPRDPRuleStartVMandConnect.ps1
# My RG
$resourceGroup = "MyResourceGroup"
# VM that will be started after updating the NSG
$VMName = "MyVM"
# NSG Name
$NSGName = "MyResourceGroupNSG"
# RDP File
$RDPFile = "C:\Users\Darren\Desktop\MyVM.rdp"
# Get my Public IP
@darrenjrobinson
darrenjrobinson / Schema.ps1
Last active Jul 10, 2019
PowerShell Azure AD B2B Microsoft Identity Manager Management Agent - Schema Script. Associated Blog Post https://blog.darrenjrobinson.com/updated-azure-ad-b2b-guest-invitations-microsoft-identity-manager-management-agent/
View Schema.ps1
$obj = New-Object -Type PSCustomObject
$obj | Add-Member -Type NoteProperty -Name "Anchor-objectID|String" -Value "08572d0b-e5e6-4b9b-bdf1-576dd90aa1d9"
$obj | Add-Member -Type NoteProperty -Name "objectClass|String" -Value "AADUser"
$obj | Add-Member -Type NoteProperty -Name "AADUserType|String" -Value "Member|Guest"
$obj | Add-Member -Type NoteProperty -Name "ID|String" -Value "08572d0b-e5e6-4b9b-bdf1-576dd90aa1d9"
$obj | Add-Member -Type NoteProperty -Name "AADAccountEnabled|Boolean" -Value $True
$obj | Add-Member -Type NoteProperty -Name "AADGuestUser|Boolean" -Value $True
$obj | Add-Member -Type NoteProperty -Name "AADDisplayName|String" -Value "Mary Jay Bligh"
$obj | Add-Member -Type NoteProperty -Name "AADGivenName|String" -Value "Mary"
$obj | Add-Member -Type NoteProperty -Name "AADImmutableId|String" -Value "dbJRmSjG3USE++q48Wk34g=="
View Nightly FIM-MIM Sync and Service Config Backup.ps1
# Username for connection to MIM Sync Server via Function Application Settings
$username = $env:MIMSyncCredUser
# Password for connection to MIM Sync Server via Function Application Settings
$pw = $env:MIMSyncCredPassword
# Credentials password (encrypted)
$keypath = 'D:\home\site\wwwroot\MyDevMIMBackup\keys\MIMSync.key'
$password = $pw | ConvertTo-SecureString -key (Get-Content $keypath)
# Create PS Creds
$credentials = New-Object System.Management.Automation.PSCredential $Username,$password
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"
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
You can’t perform that action at this time.