grahamr975 / EWS-Office365-Contact-Sync

Uses Exchange Web Services to synchronize a Global Address List in Office 365 to a user's mailbox
MIT License
94 stars 21 forks source link

Sync Pager #101

Open DanielRonies opened 5 months ago

DanielRonies commented 5 months ago

Hello!

Great job man!

Its possible sync the attribute "pager"?

Thank you!!

grahamr975 commented 4 months ago

@DanielRonies

I've never tested this, but in theory, you should be able to modify the Set-EXCContactObject.ps1 & New-EXCContactObject.ps1 functions to set on the pager on the contact. You'll of course need to pass the pager from the GAL for each user into the script; I'm not sure if the ExchangeOnline "Get-user" command includes the pager.

if ($PagerPhone -and $PagerPhone -ne "")
        {
            $Contact.PhoneNumbers[[Microsoft.Exchange.WebServices.Data.PhoneNumberKey]::Pager] = $Pager
        }

EWS Contact Phone Types Documentation: https://learn.microsoft.com/en-us/dotnet/api/microsoft.exchange.webservices.data.phonenumberkey?view=exchange-ews-api

DanielRonies commented 4 months ago

Good morning,

thanks for your answer.

The if that you indicate, we must add it in ps1 "Set-EXCContactObject" and "New-EXCContactObject", once this is done, where we indicate the "get" that you mention.

Thank you so much!!

grahamr975 commented 2 months ago

@DanielRonies Sorry for the very late reply! By Get-User, I mean that in order to set the pager for a contact, you'd first need to fetch the pager value from the Office 365 GAL for each user.