Project

O365Synchronizer

O365Synchronizer is a PowerShell module that allows you to synchronize users/contacts to user mailboxes contact list. It can also be used to synchronize users between tenants as contacts or guests.

Stars45
Forks12
Open issues2
PowerShell Gallery downloads2768
Releasev1.0.3
Language: PowerShell Updated: 2026-03-27T08:42:17.0000000+00:00

Curated Examples

Clear synchronized personal contacts

Preview cleanup of synchronized contacts from a mailbox folder.

This pattern is useful when you need to remove only contacts previously stamped by O365Synchronizer.

It is adapted from Examples/01.PersonalContactsClear.ps1.

Example

Import-Module O365Synchronizer

$clientId = '<application-id>'
$tenantId = '<tenant-id>'
$clientSecret = '<client-secret>'

$credential = [pscredential]::new($clientId, (ConvertTo-SecureString $clientSecret -AsPlainText -Force))
Connect-MgGraph -ClientSecretCredential $credential -TenantId $tenantId -NoWelcome

Clear-O365PersonalContact `
    -Identity '[email protected]' `
    -GuidPrefix 'O365Synchronizer' `
    -FolderName 'O365Sync' `
    -WhatIf

What this demonstrates

  • connecting with application credentials
  • targeting one pilot mailbox
  • previewing cleanup of synchronized contacts only

Source