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
PARAM | |
( | |
$Username, | |
$Password, | |
$Credentials, | |
$OperationType, | |
[bool] $usepagedimport, | |
[int]$pagesize | |
) |
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
$obj = New-Object -Type PSCustomObject | |
$obj | Add-Member -Type NoteProperty -Name "Anchor-Employee ID|String" -Value "" | |
$obj | Add-Member -Type NoteProperty -Name "objectClass|String" -Value "person" | |
$obj | Add-Member -Type NoteProperty -Name "First Name|string" -Value "string" | |
$obj | Add-Member -Type NoteProperty -Name "Last Name|string" -Value "string" | |
$obj | Add-Member -Type NoteProperty -Name "Title|string" -Value "string" | |
$obj | Add-Member -Type NoteProperty -Name "Department|string" -Value "string" | |
$obj | Add-Member -Type NoteProperty -Name "Employee Type|string" -Value "string" | |
$obj | Add-Member -Type NoteProperty -Name "Employment Start Date|string" -Value "string" | |
$obj | Add-Member -Type NoteProperty -Name "Employment End Date|string" -Value "string" |
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 DelegatedAuthN { | |
<# | |
.SYNOPSIS | |
Authenticate to Azure AD (using Delegated Auth) and receieve Access and Refresh Tokens. | |
.DESCRIPTION | |
Authenticate to Azure AD (using Delegated Auth) and receieve Access and Refresh Tokens. | |
.PARAMETER 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
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
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
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
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 |
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
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 HTTP trigger function processed a request." | |
$inputData = $Request.Body | convertfrom-json | |
$emailSubject = $inputData.subject |
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
$mail = @{ | |
"personalizations" = @( | |
@{ | |
"to" = @( | |
@{ | |
"email" = "$($env:sendGridToAddress)" | |
} | |
) | |
} | |
) |