Skip to content

Instantly share code, notes, and snippets.

View TeamsFiletypesStatistics.ps1
### Teams Filetype Statistics ###
### Version 1.1 ###
### Author: Alexander Holmeset ###
### Email: alexander.holmeset@gmail.com ###
### Twitter: twitter.com/alexholmeset ###
### Blog: alexholmeset.blog ###
#Need Azure App registration with Groupd.Read.All and Site.Read.All permissions.
View AirThingsTeamsNotifications.ps1
$ClientID = "1111111111"
$ClientSecret = "11111111"
$DeviceID = "111111111"
$WebHookURL = "https://contoso.com"
$formbody = "grant_type=client_credentials&scope=read%3Adevice%3Acurrent_values&client_id=$ClientID&client_secret=$ClientSecret"
$uri = "https://accounts-api.airthings.com/v1/token"
$Token = (Invoke-RestMethod -Method Post -Uri $uri -Body $formbody -ContentType "application/x-www-form-urlencoded" -UseBasicParsing).access_token
View ImportPSTMappingCSV.ps1
$PSTfiles = dir 'c:\temp\pstfiles\PST Export_Export\03.16.2022-1208PM\Exchange' | Select-Object name
$filepath = "C:\temp\ImportPSTMapping.csv"
# Header for CSV file
"Workload,FilePath,Name,Mailbox,IsArchive,TargetRootFolder,ContentCodePage,SPFileContainer,SPManifestContainer,SPSiteUrl" | Out-File -Encoding utf8 -FilePath $filepath
foreach($PSTfile in $PSTfiles){
View SetPresence.ps1
$tenantId = 'xxxxxxxxxxx'
$ClientID = 'xxxxxxxxxxx'
$ClientSecret = 'xxxxxxxxxxx'
$users = "TestUser1@alexholmeset.onmicrosoft.com","TestUser2@alexholmeset.onmicrosoft.com"
#Number of hours the presence should be valid.
$Hours = "8"
View DLMigration.ps1
#Connect with source tenant
Connect-AzureAD
#Connect with destination tenant
Connect-ExchangeOnline
$DL = "distrobutionlist1","distrobutionlist2"
$SourceDomain = "alexholmeset.blog"
$DestinationDomain = "contoso.com"
View TACConfigurationProfiles.ps1
### Teams Devices Configuration Profiles Uploader ###
### Version 1.0 ###
### Author: Alexander Holmeset ###
### Email: alexander.holmeset@gmail.com ###
### Twitter: twitter.com/alexholmeset ###
### Blog: alexholmeset.blog ###
### Thanks to Jens Madsen for idea and extensive CSV ###
### with predefined configuration profiles. ###
### https://twitter.com/JensHMadsen ###
View TeamsSpeedDial.ps1
#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)
View TeamsAAAdministration.ps1
Param(
[Parameter (Mandatory= $true)]
[String] $autoAttendantName,