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
$UserName = "" # Sample: cfp@christianfrohn.dk | |
Get-RemoteMailbox $UserName | Select-Object RemoteRoutingAddress, PrimarySmtpAddress |
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
# $ObjectId can be the users AAD object ID or email adress (UPN). | |
param ( | |
[Parameter (Mandatory = $true)] | |
[object]$ObjectIdOrUPN | |
) |
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
CREATE USER [NameOfServicerincipal] FROM EXTERNAL PROVIDER; | |
EXEC sp_addrolemember 'db_owner', 'NameOfServicePrincipal' |
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
$TenantId = "" | |
$ApplicationID = "" | |
$CertificateThumbprint = "" | |
Connect-MicrosoftTeams -CertificateThumbprint $CertificateThumbprint -ApplicationId $ApplicationID -TenantId $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
$ClientSecret = "" | |
$ApplicationID = "" | |
$TenantID = "" | |
$graphtokenBody = @{ | |
Grant_Type = "client_credentials" | |
Scope = "https://graph.microsoft.com/.default" | |
Client_Id = $ApplicationID | |
Client_Secret = $ClientSecret | |
} |
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
$HolidayID = Get-CsOnlineSchedule -Id "e48d56a7-461a-46b5-962c-196f6e85145d" | |
$HolidayID.FixedSchedule.DateTimeRanges += New-CsOnlineDateTimeRange -Start "05/06/2022" -End "06/06/2022" | |
Set-CsOnlineSchedule -Instance $HolidayID -Verbose |
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
$CN = "MyAppReg" #Name of your cert. | |
$cert=New-SelfSignedCertificate -Subject "CN=$CN" -CertStoreLocation "Cert:\CurrentUser\My" -KeyExportPolicy Exportable -KeySpec Signature -NotAfter (Get-Date).AddYears(5) | |
#Thumbprint - Make note of this | |
$Thumbprint = $Cert.Thumbprint | |
#Export cert. to download folder - FilePath can be changed to your linking | |
Get-ChildItem Cert:\CurrentUser\my\$Thumbprint | Export-Certificate -FilePath $env:USERPROFILE\Downloads\AppRegCert.cer | |
Write-Output "$Thumbprint <- Copy/paste this (save it)" |
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
#Installs the Microsoft Graph PowerShell module - Remeber to start PowerShell as admin to be able to install. | |
Install-Module -Name Microsoft.Graph -verbose |
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
$AppID = "" | |
$TenantID = "" | |
$Thumbprint = "" | |
Connect-MgGraph -ClientId $AppID -TenantId $TenantID -CertificateThumbprint $Thumbprint |
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
#This code below will provide with you with the ID of a Teams meeting using the Join URL - The Join URL can be found in a Teams Meeting invitation | |
#This can be used in Connection to Get-MgUserOnlineMeeting & Get-MgUserOnlineMeetingAttendanceReport | |
Connect-MgGraph #Choose a method (Dealers choice) | |
$UserId = "" #Can be found on the user object page in AzureAD (one of many ways) | |
JoinURL = "" #Right click "Join Teams Meeting" in the meeting invite and paste in here | |
$decodedUrl = [System.Web.HttpUtility]::UrlDecode($JoinUrl) #This to get rid of "%20" etc in the url |