This file contains hidden or 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
| $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") |
This file contains hidden or 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 | |
| ( | |
| [Parameter (Mandatory = $false)] | |
| [object] $WebhookData | |
| ) | |
| $teamsWebhookUrl = "" | |
| $Body = (ConvertFrom-Json -InputObject $WebhookData.RequestBody) |
This file contains hidden or 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) | |
| $runBookUrl = "" | |
| $Request.Body | |
| # Set time zones |
This file contains hidden or 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
| $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"} |
This file contains hidden or 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
| $defaultOverFlowThreshold = 10 | |
| $webHookUrl = "" | |
| $Credentials = Get-AutomationPSCredential -Name "AzAutomationAdmin" | |
| Connect-MicrosoftTeams -Credential $Credentials | |
| $allCallQueues = Get-CsCallQueue -WarningAction SilentlyContinue | |
| foreach ($callQueue in $allCallQueues) { |
This file contains hidden or 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) | |
| $action = $Request.Body.actionType | |
| $callQueueName = $Request.Body.QueueName | |
| $callQueueId = $Request.Body.QueueId | |
| $targetNumber = $Request.Body.Number |
This file contains hidden or 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 | |
| ( | |
| [Parameter (Mandatory = $false)] | |
| [object] $WebhookData | |
| ) | |
| $uri = "Your Teams Channel Webhook URL" | |
| $Body = (ConvertFrom-Json -InputObject $WebhookData.RequestBody) |
This file contains hidden or 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) | |
| $uri = "Your Runbook Webhook URL" | |
| $refreshUri = "Your Refresh Card Function URL" | |
| $actionCardCq = @' | |
| { |
This file contains hidden or 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
| Connect-MicrosoftTeams | |
| $allCallQueues = Get-CsCallQueue -WarningAction SilentlyContinue | |
| $choices = @() | |
| $callQueueCounter = 1 | |
| foreach ($callQueue in $allCallQueues) { |
This file contains hidden or 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
| # 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, |