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
@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 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]@{
View Make IdentityNow Identity Attribute Searchable.ps1
$orgName = "yourOrgname"
# Get Identity Attr
$getIdentityAttributesBaseURI = "https://$($orgName).api.identitynow.com/cc/api/identityAttribute/list"
# Get Attr Only
$getIdentityAttrBaseURI = "https://$($orgName).api.identitynow.com/cc/api/identityAttribute/get?name="
# Update URI
$attributeUpdateBaseURI = "https://$($orgName).api.identitynow.com/api/identityAttribute/update?"
$identityAttrs = Invoke-RestMethod -Method Get -Uri $getIdentityAttributesBaseURI -Headers @{Authorization = "$($v3Token.token_type) $($v3Token.access_token)"; "content-type" = "application/json"}
@darrenjrobinson
darrenjrobinson / SailPoint IdentityNow AzureAD Source Filter.ps1
Last active Mar 31, 2019
SailPoint IdentityNow AzureAD Source Filters - Cloud Only Accounts, Guest (B2B) Accounts, Hybrid (AD & AAD) Accounts. Associated post https://blog.darrenjrobinson.com/building-sailpoint-identitynow-azure-ad-source-filters/
View SailPoint IdentityNow AzureAD Source Filter.ps1
# IdentityNow Organisation Name
$orgName = "CompanyName"
# AAD GUESTS (B2B)
$AADSourceUserFilters = @{}
$AADSourceUserFilters.Add("connector_userFilters", "userType eq 'guest'")
$AADSourceUpdateURI = "https://$($orgName).api.identitynow.com/cc/api/source/update/SOURCENumber"
$updateSource = Invoke-RestMethod -Method Post -Uri $AADSourceUpdateURI -Headers @{Authorization = "$($v3Token.token_type) $($v3Token.access_token)"} -Body $AADSourceUserFilters
You can’t perform that action at this time.