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