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
{ | |
"type": "object", | |
"properties": { | |
"id": { | |
"type": "string" | |
}, | |
"object": { | |
"type": "string" | |
}, | |
"created": { |
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
{ | |
"messages": [ | |
{ | |
"role": "system", | |
"content": "You are a helpful assistant. You reply to all emails for me. My signature should be Alexander Holmeset, Senior Cloud Consultant, Contoso. You can reply in all languages. format your reply in html" | |
}, | |
{ | |
"role": "user", | |
"content": "@{item()?['bodyPreview']}. The following is a history of previous emails, dont add it to your reply. @{variables('EmailHistory')}" | |
} |
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
# Connect to Azure Account | |
Connect-AzAccount | |
# Connect to Microsoft Teams | |
Connect-MicrosoftTeams | |
# Connect to Exchange Online | |
Connect-ExchangeOnline | |
# Connect to SharePoint Online | |
$SPConnection = Connect-PnPOnline -Url https://alexholmeset-admin.sharepoint.com -Interactive | |
# Get access token for Microsoft Graph API |
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 Get-AzureOpenAIToken1{ | |
<# .SYNOPSIS | |
Get an azure token for user or managed identity thats required to authenticate to Azure OpenAI with Rest API. | |
Also construct the header if you are using an Azure OpenAI API key instead of Azure AD authentication. | |
.PARAMETER ManagedIdentity | |
Use this parameter if you want to use a managed identity to authenticate to Azure OpenAI. | |
.PARAMETER User | |
Use this parameter if you want to use a user to authenticate to Azure OpenAI. | |
.PARAMETER APIKey | |
Use this parameter if you want to use an API key to authenticate to Azure OpenAI. |
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 the Azure AD Internals module. | |
Import-Module AADInternals | |
#Users to process | |
$Users = import-csv c:\temp\users.csv | |
foreach($user in $users){ | |
$password = ConvertTo-SecureString $user.password -AsPlainText -Force | |
$Cred = New-Object System.Management.Automation.PSCredential -ArgumentList ($($user.upn), $password) |
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
, | |
"additionalLoginParams": [ | |
"response_type=code id_token", | |
"https://graph.microsoft.com", | |
"(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
using namespace System.Net | |
using namespace System.IO | |
# 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." |
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
#Enter email account you want to send email reminders from | |
$Email = "enter email here" | |
#Enter Logicapp URL | |
$LogicAppURL = "enter webhook url here" | |
#If subject is hidden in meeting room calendar, set this to true so we get the subject from organizers calendar instead. | |
$HiddenSubject = $true |
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
#Requires -Modules Microsoft.Graph | |
# Install the module. (You need admin on the machine.) | |
# Install-Module Microsoft.Graph | |
# Set Static Variables | |
$TenantID="enter here" | |
$AutomationAccountDisplayname ="enter here" | |
$LogicAppDisplayname = "enter here" | |
# Define dynamic variables |
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
$AzureSpeechSubscriptionKey = 'enter your key here' | |
$AzureSpeechRegion = 'norwayeast' | |
$Language = 'en-us' | |
$VoiceName = 'en-US-JennyNeural' | |
$Style = 'whispering' | |
$FetchTokenHeader = @{ | |
'Content-type'='application/x-www-form-urlencoded'; | |
'Content-Length'= '0'; | |
'Ocp-Apim-Subscription-Key' = $AzureSpeechSubscriptionKey |
NewerOlder