Skip to content

Instantly share code, notes, and snippets.

View mozziemozz's full-sized avatar
🏖️
Out of office

Martin Heusser mozziemozz

🏖️
Out of office
View GitHub Profile
$allPages = @()
$aadUsers = (Invoke-RestMethod -Uri "https://graph.microsoft.com/v1.0/users?`$top=5" -Headers $Header -Method Get -ContentType "application/json")
$allPages += $aadUsers.value
if ($aadUsers.'@odata.nextLink') {
do {
$aadUsers = (Invoke-RestMethod -Uri $aadUsers.'@odata.nextLink' -Headers $Header -Method Get -ContentType "application/json")
param
(
[Parameter (Mandatory = $false)]
[object] $WebhookData
)
$teamsWebhookUrl = ""
$Body = (ConvertFrom-Json -InputObject $WebhookData.RequestBody)
using namespace System.Net
# Input bindings are passed in via param block.
param($Request, $TriggerMetadata)
$runBookUrl = ""
$Request.Body
# Set time zones
$functionUrl = ""
$teamsWebhookUrl = ""
$defaultLocalTimeZone = "W. Europe Standard Time"
$Credentials = Get-AutomationPSCredential -Name "AzAutomationAdmin"
Connect-MicrosoftTeams -Credential $Credentials
$dateToday = Get-Date
$holidaySchedules = Get-CsOnlineSchedule | Where-Object {$_.Type -eq "Fixed"}
$defaultOverFlowThreshold = 10
$webHookUrl = ""
$Credentials = Get-AutomationPSCredential -Name "AzAutomationAdmin"
Connect-MicrosoftTeams -Credential $Credentials
$allCallQueues = Get-CsCallQueue -WarningAction SilentlyContinue
foreach ($callQueue in $allCallQueues) {
using namespace System.Net
# Input bindings are passed in via param block.
param($Request, $TriggerMetadata)
$action = $Request.Body.actionType
$callQueueName = $Request.Body.QueueName
$callQueueId = $Request.Body.QueueId
$targetNumber = $Request.Body.Number
param
(
[Parameter (Mandatory = $false)]
[object] $WebhookData
)
$uri = "Your Teams Channel Webhook URL"
$Body = (ConvertFrom-Json -InputObject $WebhookData.RequestBody)
using namespace System.Net
# Input bindings are passed in via param block.
param($Request, $TriggerMetadata)
$uri = "Your Runbook Webhook URL"
$refreshUri = "Your Refresh Card Function URL"
$actionCardCq = @'
{
Connect-MicrosoftTeams
$allCallQueues = Get-CsCallQueue -WarningAction SilentlyContinue
$choices = @()
$callQueueCounter = 1
foreach ($callQueue in $allCallQueues) {
# Author: Martin Heusser (@mozzeph)
# Required Scopes: "profile", "openid", "User.Read.All", "Chat.Create"
$AppId = ''
$AppSecret = ''
$TenantName = ''
function Connect-HTTPGraph {
param (
[Parameter(Mandatory=$true)][String]$AppId,