Ever wondered who called you from your organisation on your iPhone/Android device? Microsoft makes it unnecesarily hard to sync Global Address List contacts to your phone. Yes Outlook works great... but it does not sync with your native contacts app, so pretty useless when it comes to resolving the caller ID.
-
Please register an app following Microsoft's guide. For authentication client credentials are necesary, all other forms of authentication won't be necesary.
-
Assign permissions to te app, read the list of permissions below and see why they need those permissions. This solution works on the least privelege model, so nothing more than necesarry needs to be applied.
-
Download a copy of this repository, you can do so the easiest by typing
git clone https://github.com/JeshuaEdgar/gal-sync-graph
in a commandline if you have git-scm or a git client installed on your machine. If not, you can go to the top, click the green "Code" button and hitting "Download ZIP". -
Use
Mew-StoredCredential.ps1
to store the credentials securely on your system, this will make sure the script runs unattended. -
Check out example.bat, and tweak the parameters if necessary. Please check all documentation of available parameters.
-
Check commandline output/logs for potential troubleshooting, you can always shoot in a issue on GitHub.
-
Mandatory
-CredentialPath "C:\Path\To\Credentials\credential.cred
- Use
New-StoredCrdential.ps1
to store a new credential, it will automatically createa a credential folder and a file inside of it for unattenant scripts.
- Use
-Tenant "22f2c12f-22f3-4c85-bf2c-e3f6ae7fa75b"
- Provide tenant ID from Azure AD or use the default *.onmicrosoft.com address from your organisation.
-ContactFolderName "GAL Sync"
- Provide the name of the folder that will be created under the default Contacts folder.
-
Optional
-Directory
- Use this option if you want everyone in the organisation to have the GAL list synced.
-AzureADGroup "SG_GALSync"
- Use this option if you want to target a certain Azure AD Group.
-MailboxList @("mailbox1@tosync.net", "mailbox2@tosync.net", "mailbox3@tosync.net")
- Use this option if you want to just sync a few mailboxes.
-LogPath C:\Path\To\Logs
- Define this if you want logs.
-ContactsWithoutPhoneNumber
- Use this option if you want to sync GAL contacts without phone numbers.
-ContactsWithoutEmail
- Use this option if you want to sync GAL contacts without email address.
- User.Read.All
- Group.Read.All
- OrgContact.Read.All
- Contacts.ReadWrite