View Update SuccessFactors Email Address including isPrimary.ps1
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 |
View Query Microsoft Graph with Python and Decode AAD Access Token.py
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 |
View WordPress API Authentication.ps1
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
# V2 APIs | |
# Basic AuthN | |
$userID = 'yourWordpressAccountAlias' | |
$userPassword = 'ABCD wTUZ pIST 9jEo 99LV 1234' | |
$Bytes = [System.Text.Encoding]::utf8.GetBytes("$($userID):$($userPassword)") | |
$encodedAuth = [Convert]::ToBase64String($Bytes) | |
$header = @{Authorization = "Basic $($encodedAuth)" } | |
Invoke-RestMethod -method get -uri "https://yourwordpressURL/wp-json/wp/v2/posts" -headers $header |
View MSGraph AuthCode with PKCE.ps1
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-module PKCE | |
import-module JWTDetails | |
$clientID = '<your AAD clientID>' | |
$tenantID = '<your AAD tenantID' | |
$clientSecret = '<your AAD App Client Secret>' | |
$replyURL = 'https://localhost/' | |
$scopes = 'user.read.all' | |
Function Get-AuthCode { |
View Get Microsoft Graph Permission Scope IDs.ps1
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
# Get Service Principals | |
$spList = az ad sp list --all | |
$spListObj = $spList | ConvertFrom-Json | |
# Get Graph Permissions | |
$graphSP = $spListObj | Where-Object {$_.appID -eq '00000003-0000-0000-c000-000000000000'} | Select-Object | |
# List of Application Scopes | |
$adminScopes = $graphSP.oauth2Permissions | Where-Object {$_.type -eq 'Admin'} | Sort-Object value | Select-Object id, isEnabled, type, adminConsentDescription, adminConsentDisplayName, value |
View Get AAD FIDO2 Token Details.ps1
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
#Install-Module MSAL.PS | |
Import-Module MSAL.PS | |
$resource = "https://graph.windows.net" # AzureAD Graph | |
$apiVersion = "api-version=1.6-internal" # Internal API | |
$scope = "user_impersonation" # Delegated User Impersonation | |
$clientID = "1b730954-1685-4b74-9bfd-dac224a7b894" # PowerShell | |
$tenantID = "yourcompanyAADName.com" # AAD | |
$myUPN = "useruserUPN@yourcompanyAADName.com" # User UPN |
View Interactive MSAL AAD Delegated AuthN.py
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 | |
from msal_extensions import * | |
# Microsoft Azure PowerShell Client ID | |
clientID = '1950a258-227b-4e31-a9cf-717495945fc2' |
View AAD User B2B Guest Federation Report.ps1
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-Module MSAL.PS | |
Import-Module AzureADTenantID | |
# Use the Azure PowerShell Well-Known Client ID | |
$clientID = "1950a258-227b-4e31-a9cf-717495945fc2" | |
# Get UserUPN | |
$userUPN = Read-Host -Prompt "Please enter Azure AD User UPN" | |
$tenantName = $userUPN.Split("@")[1] | |
$tenantID = Get-AzureADTenantId -domain $tenantName |
View run.ps1
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
using namespace System.Net | |
# Input bindings are passed in via param block. | |
param($Request, $TriggerMetadata) | |
# Write to the Azure Functions log stream. | |
Write-Host "PowerShell AzureAD Query HTTP trigger function received a request." | |
Write-Host $Request.Body | |
# Write-Host $Request.Query |
View run.ps1
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
# Input bindings are passed in via param block. | |
param($Timer) | |
# Get the current universal time in the default string format | |
$currentUTCtime = (Get-Date).ToUniversalTime() | |
# The 'IsPastDue' porperty is 'true' when the current function invocation is later than scheduled. | |
if ($Timer.IsPastDue) { | |
Write-Host "PowerShell timer is running late!" | |
} |
NewerOlder