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 Connect to OID.ps1
# Needs reference to .NET assembly used in the script.
Add-Type -AssemblyName System.DirectoryServices.Protocols
$username = 'cn=ldapUser'
$pwd = 'S3cur3P@$$W0rd'
$server = "ldap.customer.com.au"
$port = "80001"
$password = $pwd | ConvertTo-SecureString -asPlainText -Force
# Top Level OU under which users are located
$ldapSearchBase = "cn=users,dc=customer,dc=com,dc=au"
# Filter to find the user we are connecting with
@darrenjrobinson
darrenjrobinson / OracleSQLStoredProcedure.ps1
Last active Jun 12, 2019
Execute Oracle SQL DB Stored Procedure using PowerShell and ODAC.NET (so no Oracle Client required). Associated blogpost https://blog.darrenjrobinson.com/using-powershell-to-query-oracle-dbs-without-using-the-oracle-client-oracle-data-provider-for-net/
View OracleSQLStoredProcedure.ps1
# Path to ODAC.NET Installation
Add-Type -Path "c:\ODAC\odp.net\managed\common\Oracle.ManagedDataAccess.dll"
$reader = $false
# SQL DB Username, Password and DataSource Alias (as per tnsnames.ora)
$username = "SQLQueryUserName"
$password = "SQLUserPassword"
# Alias from TNSNames.ora
$datasource = "IDM"
View OracleSQLQuery.ps1
# Path to ODAC.NET Installation
Add-Type -Path "c:\ODAC\odp.net\managed\common\Oracle.ManagedDataAccess.dll"
$reader = $false
# SQL DB Username, Password and DataSource Alias (as per tnsnames.ora)
$username = "SQLQueryUserName"
$password = "SQLUserPassword"
# Alias from TNSNames.ora
$datasource = "IDM"
View Create IdentityNow ServiceNow Integration Configuration.json
{
"attributes": {
"authType": "Basic",
"username": "IdentityNowServiceAccount_in_ServiceNow",
"password": "IdentityNowServiceAccount_Password",
"url": "https://yourServiceNowTenant.service-now.com",
"serviceNowAppName" : "ServiceNow [source-42423]",
"catalogItem": {
"2c9180856a93cecd016a9ed337615c35": "a632c040db25f30033501c0e049619af"
}
View Get and Update IdentityNow Org Config.ps1
# IdentityNow Orgname
$orgName = "yourOrgname"
# IdentityNow Admin User
$adminUSR = [string]"yourOrgAdminID".ToLower()
$adminPWDClear = 'yourOrgAdminPasswrd'
# Generate the password hash
# Requires Get-Hash from PowerShell Community Extensions (PSCX) Module
# https://www.powershellgallery.com/packages/Pscx/3.2.2
@darrenjrobinson
darrenjrobinson / Azure LogAnalytics Report to CSV.ps1
Last active May 21, 2019
Azure Log Analytics Report using KQL via REST API with PowerShell output to CSV. Associated blogpost https://blog.darrenjrobinson.com/?p=39731
View Azure LogAnalytics Report to CSV.ps1
#The resource URI
$resource = "https://westus2.api.loganalytics.io"
#Your Client ID and Client Secret obtained when registering your WebApp
$clientid = "yourAADAppClientID"
$clientSecret = "yourAADAppClientSecret"
#Your Reply URL configured when registering your WebApp
$redirectUri = "https://localhost"
#Scope
$scope = "Data.Read"
Add-Type -AssemblyName System.Web
View WindowsTerminal.json
{
"defaultProfile": "{5232b930-2f97-47b0-8042-75c9932cbc5e}",
"initialRows": 30,
"initialCols": 120,
"alwaysShowTabs": true,
"showTerminalTitleInTitlebar": false,
"experimental_showTabsInTitlebar": false,
"profiles": [
{
"startingDirectory": "%USERPROFILE%",
@darrenjrobinson
darrenjrobinson / BOFH - Run.ps1
Last active Apr 25, 2019
Bastard Operator From Hell - Azure PowerShell Function App Excuse Generator
View BOFH - Run.ps1
function BOFHExcuse {
# BOFH Excuse Generator
$first = @("Temporary","Intermittant","Partial","Redundant","Total","Multiplexed","Inherent","Duplicated","Dual-Homed","Synchronous","Bidirectional","Serial","Asynchronous","Multiple","Replicated","Non-Replicated","Unregistered","Non-Specific","Generic","Migrated","Localised","Resignalled","Dereferenced","Nullified","Aborted","Serious","Minor","Major","Extraneous","Illegal","Insufficient","Viral","Unsupported","Outmoded","Legacy","Permanent","Invalid","Deprecated","Virtual","Unreportable","Undetermined","Undiagnosable","Unfiltered","Static","Dynamic","Delayed","Immediate","Nonfatal","Fatal","Non-Valid","Unvalidated","Non-Static","Unreplicatable","Non-Serious")
$second = @("Array","Systems","Hardware","Software","Firmware","Backplane","Logic-Subsystem","Integrity","Subsystem","Memory","Comms","Integrity","Checksum","Protocol","Parity","Bus","Timing","Synchronisation","Topology","Transmission","Reception","Stack","Framing","Code","Programming","Periphe
View Get IdentityNow VA Clusters.ps1
# IdentityNow Orgname
$orgName = "yourOrgName"
# IdentityNow Admin User
$adminUSR = [string]"YourAdminAccount".ToLower()
$adminPWDClear = 'yourAdminPassword'
# Generate the password hash
# Requires Get-Hash from PowerShell Community Extensions (PSCX) Module
# https://www.powershellgallery.com/packages/Pscx/3.2.2
View Azure Function Table Service Output Binding.ps1
$breweryDBURI = 'https://sandbox-api.brewerydb.com/v2/'
$key = 'myAPIKey'
$stylesURI = "$($breweryDBURI)styles?key=$($key)"
$beerStyles = Invoke-RestMethod -Uri $stylesURI -Method Get
[PSObject []] $outputArray = $null
foreach ($style in $beerStyles.data){
$entity = [PSObject]@{
You can’t perform that action at this time.