-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
760c625
commit c406824
Showing
2 changed files
with
20 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,11 +8,17 @@ Connect-MgGraph -ClientSecretCredential $Credentials -TenantId $TenantID -NoWelc | |
|
||
# this is useful to clear current user contacts (if you have some) | ||
# this will only delete synchronized ones (based on FileAs property that has to convert to GUID) | ||
Clear-O365PersonalContact -Identity 'slawa@evotec.pl' -WhatIf | ||
Clear-O365PersonalContact -Identity 'testAccount@evotec.pl' -WhatIf | ||
|
||
# this is useful to clear current user contacts (if you have some) | ||
# this will only delete synchronized ones (based on FileAs property that has to convert to GUID, with GUID prefix) | ||
Clear-O365PersonalContact -Identity 'przemyslaw@evotec.pl' -GuidPrefix 'O365Synchronizer' -WhatIf | ||
Clear-O365PersonalContact -Identity 'testAccount@evotec.pl' -GuidPrefix 'O365Synchronizer' -WhatIf | ||
|
||
# this will delete all contacts | ||
Clear-O365PersonalContact -Identity '[email protected]' -All -WhatIf | ||
Clear-O365PersonalContact -Identity '[email protected]' -All -WhatIf | ||
|
||
# this will only delete synchronized ones (based on FileAs property that has to convert to GUID, with GUID prefix) from specific folder | ||
Clear-O365PersonalContact -Identity '[email protected]' -GuidPrefix 'O365Synchronizer' -FolderName 'O365' -WhatIf | ||
|
||
# this will only delete synchronized ones (based on FileAs property that has to convert to GUID, with GUID prefix) from specific folder, including the folder | ||
Clear-O365PersonalContact -Identity '[email protected]' -GuidPrefix 'O365Synchronizer' -FolderName 'O365Sync' -FolderRemove -WhatIf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,4 +9,14 @@ $Credentials = [pscredential]::new($ClientID, (ConvertTo-SecureString $ClientSec | |
Connect-MgGraph -ClientSecretCredential $Credentials -TenantId $TenantID -NoWelcome | ||
|
||
# synchronize contacts for two users of two types (Member, Contact) using GUID prefix | ||
Sync-O365PersonalContact -UserId '[email protected]', '[email protected]' -Verbose -MemberTypes 'Member', 'Contact' -GuidPrefix 'O365Synchronizer' -WhatIf | Format-Table * | ||
Sync-O365PersonalContact -UserId '[email protected]', '[email protected]' -Verbose -MemberTypes 'Member', 'Contact' -GuidPrefix 'O365Synchronizer' -WhatIf | Format-Table * | ||
|
||
# synchronize contacts for 1 user of two types (Member, Contact) using GUID prefix and filtering by company name | ||
# this will only synchronize contacts that have CompanyName starting with 'Evotec' or 'Ziomek' | ||
# this will also require contacts to be in a group by 'e7772951-4b0e-4f10-8f38-eae9b8f55962' | ||
# this will also create a folder 'O365Sync' in user's personal contacts and put synchronized contacts there | ||
# this will also return the results in a table | ||
Sync-O365PersonalContact -UserId '[email protected]' -MemberTypes 'Contact', 'Member' -GuidPrefix 'O365Synchronizer' -PassThru { | ||
Sync-O365PersonalContactFilter -Type Include -Property 'CompanyName' -Value 'Evotec*','Ziomek*' -Operator 'like' | ||
Sync-O365PersonalContactFilterGroup -Type Include -GroupID 'e7772951-4b0e-4f10-8f38-eae9b8f55962' | ||
} -FolderName 'O365Sync' | Format-Table |