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
96 stars 21 forks source link

Sync contacts from a public folder #26

Closed DanMAr27 closed 3 years ago

DanMAr27 commented 3 years ago

Hi, using this script it would be possible to synchronize contacts from a public folder ?? what changes should be made to this line of code ?? $GALContacts = Get-GALContacts -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credentials $Credential -ExcludeContactsWithoutPhoneNumber $ExcludeContactsWithoutPhoneNumber -ExcludeSharedMailboxContacts $ExcludeSharedMailboxContacts -IncludeNonUserContacts $IncludeNonUserContacts

grahamr975 commented 3 years ago

I think that this is possible using EWS or maybe Graph API. I currently use Remote Powershell to directly fetch a list of users. I've found this to be more reliable for my purposes. If you're interested in writing this yourself, I'd suggest taking a look at the API here for a good start: https://github.com/gscales/Powershell-Scripts/tree/master/EWSContacts