This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Your API Client ID | |
$clientID = 'yourClientID' | |
# Your API Client Secret | |
$clientSecret = 'yourSecret' | |
$Bytes = [System.Text.Encoding]::utf8.GetBytes("$($clientID):$($clientSecret)") | |
$encodedAuth = [Convert]::ToBase64String($Bytes) | |
# Your IdentityNow Tenant Name | |
$orgName = 'yourOrg' | |
# IdentityNow Admin User and PWD to connect with via oAuth | |
$adminUSR = [string]"yourAdminAccount".ToLower() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Authenticate | |
$clientID = 'myGitHubUsername' | |
# GitHub API Client Secret | |
$clientSecret = '21c22a9f0ca888373a3077614d0abcdefghijklmnop' | |
# Basic Auth | |
$Bytes = [System.Text.Encoding]::utf8.GetBytes("$($clientID):$($clientSecret)") | |
$encodedAuth = [Convert]::ToBase64String($Bytes) | |
# Search based on Description | |
$search = "Import Script" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function AuthN { | |
<# | |
.SYNOPSIS | |
Authenticate to Azure AD and receieve Access and Refresh Tokens. | |
.DESCRIPTION | |
Authenticate to Azure AD and receieve Access and Refresh Tokens. | |
.PARAMETER tenantID | |
(required) Azure AD TenantID. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import msal | |
import jwt | |
import json | |
import sys | |
import requests | |
from datetime import datetime | |
global accessToken | |
global requestHeaders | |
global tokenExpiry |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import msal | |
import jwt | |
import json | |
import requests | |
import pandas as pd | |
from datetime import datetime | |
accessToken = None | |
requestHeaders = None | |
tokenExpiry = None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$Global:headers = $null | |
$Global:SSFBaseURI = "https://api10preview.sapsf.com/odata/v2/" | |
$Global:SSFBusinessEmailType = "159139" | |
$Global:SSFPersonalEmailType = "159140" | |
Function Connect-SSF { | |
[cmdletbinding()] | |
param( | |
[Parameter(Mandatory = $true, ValueFromPipeline = $true)] | |
[string]$SSFBaseURI |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import wincertstore | |
import base64 | |
import ssl | |
import os | |
from cryptography import x509 | |
from cryptography.hazmat.backends import default_backend | |
from cryptography.hazmat.primitives import hashes | |
from cryptography.x509.oid import ExtensionOID | |
# Certificate Name & Thumbprint to look for |