There is no light out here.

Dark mode is the only mode.

Force Removal Orphaned Contact in Microsoft 365

The Problem Classic Exchange Online scenario - trying to remove an orphaned (maybe used to be synced) object. Getting slapped in the face with error The Solution Two words: Graph API. Step 1: Get the Mail Contact ID First, we need to identify the exact object we’re dealing with: 1 Get-MailContact [email protected] | Format-List Id This will give the unique identifier for the mail contact. Step 2: Verify the Object in Graph API Better safe than sorry- let’s do a double check. Replace <ID> with the ID from Step 1: ...

January 26, 2026 · 1 min · 177 words · Przemek

How to Get Rid of Power Apps Permissions Consent Form

Permissions Consent Pop-up Every new user must approve permissions when accessing an app. Existing users see this prompt again after app logic or connector updates. App permissions consent pop-up In most scenarios, this pop-up can be bypassed. Hiding consent pop-up This requries a single PowerShell command: 1 Set-AdminPowerAppApisToBypassConsent -EnvironmentName [Guid] -AppName [Guid] Expected result: BypassConsent flag is set We can get guids using PowerShell: ...

January 11, 2026 · 2 min · 356 words · Przemek

Assign Calendar Permissions in Bulk

Just a simple one-liner When you have many room mailboxes, granting someone access to each room calendar one-by-one is painful. This one-liner reads a list of room SMTP addresses from a text file and applies the same permission to each mailbox calendar. 1 2 3 4 5 Get-Content .\rooms.txt | % { Write-Host "Working on $_" -ForegroundColor Cyan Add-MailboxFolderPermission -Identity "$($_.Trim()):\Calendar" -User "[email protected]" -AccessRights Reviewer } Notes Text file we import via Get-Content contains a room email address per line .Trim is being used to remove blank spaces in TXT file - (’ [email protected]’ -> ‘[email protected]’) - it’s just a safety feature I like to use In some tenants, the calendar folder name might be localized (for example “Kalendarz” in Poland, “Kalender” in Germany and “Calendier” for France) If permissions are already granted for an user, you need to either remove these and re-add or use Set-MailboxFolderPermissions

January 10, 2026 · 1 min · 147 words · Przemek

Updating Distribution List Extended Attributes with PowerShell

The easy part Creating distribution lists in bulk is quite simple. Just a CSV file: 1 2 3 4 name,mail Fancy Group,[email protected] Another Fancy Group,[email protected] Not That Fancy Group,[email protected] And for-each loop 1 2 3 4 5 6 7 Import-Csv .\groups.csv | ForEach-Object { New-DistributionGroup -Name $_.name -PrimarySmtpAddress $_.mail -OrganizationalUnit 'OU=Groups,DC=wrong,DC=went,DC=something,DC=dev' -Type Security } Result: Name DisplayName GroupType PrimarySmtpAddress Fancy Group Fancy Group Universal, SecurityEnabled [email protected] Another Fancy Group Another Fancy Group Universal, SecurityEnabled [email protected] Not That Fancy Group Not That Fancy Group Universal, SecurityEnabled [email protected] But updating msExchExtensionAttribute is different A below won’t work as there is no such command under Set-DistributionGroup. ...

January 2, 2026 · 3 min · 440 words · Przemek

<# .SYNOPSIS Adds users from a TXT file to an Entra ID Group via Microsoft Graph. .DESCRIPTION The script reads UPNs from a text file, resolves each user (first by UPN, then by mail as fallback), and adds them to the specified group. Works with both Security Groups and Microsoft 365 Groups. .PARAMETER GroupId Object ID of the target Entra ID Group. .PARAMETER FilePath Path to the TXT file containing one UPN per line. ...

3 min · 481 words · Przemek