Intune – Use a custom detection script

Because of old installations, TeamViewer is sometimes installed in the 64 bit version and sometimes in the 32 bit version. Since I would like to have a clear overview in Intune, I created the script below.

$tv = "C:\Program Files\TeamViewer\TeamViewer.exe", "C:\Program Files (x86)\TeamViewer\TeamViewer.exe"
$result = ($tv | Test-Path) -notcontains $true

if ($result) {
    Write-Output "Not installed"
    exit 1
else {
    write-output "Teamviewer detected, exiting"
    exit 0
teamviewer detection script intune

Orca: Office 365 Advanced Threat Protection Settings

ORCA is a project to help Office 365 tenant administrators validate their anti-spam and anti-malware settings against recommendations from Microsoft. ORCA is installed as a PowerShell module with just one cmdlet. After running Get-ORCAReport, you’ll have a report containing recommendations and observations about your configuration.

  1. Login to Exchange online with powershell
  2. Install the Orca module
Install-Module -Name ORCA
  1. Get the Orca report


Powershell: Export users from AD to Excel

Export all users from AD from a specific OU (recursive) to Excel

Get-ADUser -Filter * -SearchBase $OU -SearchScope Subtree | Select-object DistinguishedName,Name,UserPrincipalName | export-csv -path c:\temp\userexport.csv

Only enabled users

Get-ADUser -Filter * -SearchBase $OU -SearchScope Subtree | Select-object DistinguishedName,Name,UserPrincipalName,Enabled | Where {$_.Enabled -like "False"} | export-csv -path c:\temp\userexport.csv 

Exchange Online: Upgrade DKIM keys to 2048-bit

Manuallly upgrade existing DKIM keys from 1024-bit to 2048-bit

Connect to Exchange online using powershell

Import-Module ExchangeOnlineManagement

Upgrade key to 2048-bit

Rotate-DkimSigningConfig -KeySize 2048 -Identity {domain name}


Rotate-DkimSigningConfig -KeySize 2048 -Identity


Get-DkimSigningConfig -identity | Select Selector1KeySize

This new 2048-bit key takes effect on the RotateOnDate, and will send emails with the 1024-bit key in the interim. After four days, you can test again with the 2048-bit key (that is, once the rotation takes effect to the second selector).

Get-DkimSigningConfig -identity | Select RotateOnDate


Connect to Exchange Online PowerShell | Microsoft Learn