Our carrier assigns mobile and landline numbers to users in Teams, while user accounts are managed in on-premises Active Directory and synchronized to Entra ID with Entra Connect. The phone fields in AD are currently updated manually—or not at all—so Teams, Entra ID, and the Outlook address book often show different numbers. Some users have a working Teams number but no directory entry, while others still display an outdated number. Has anyone automated this synchronization? I'm especially interested in whether you used a PowerShell script, an automation runbook, or a third-party tool; which system you chose as the source of truth; which AD attributes you populated, such as telephoneNumber, mobile, or ipPhone; how you handled unpublished or exceptional numbers; and what permissions were required in Teams, Entra ID, and Active Directory.
3 Answers
A scheduled PowerShell job can handle this. Use the Teams or phone-system API to retrieve assigned numbers, match them to the corresponding users, and update the selected AD attributes. Running it on an internal Windows server as a scheduled task is straightforward, though an Azure Automation runbook is another option if it can securely reach your directory.
Choose one system of record before automating anything. If AD drives the address book, populate telephoneNumber—and mobile or ipPhone only when you have a clearly defined purpose—and allow the normal Entra synchronization to carry the data onward. Exclude call queues, auto attendants, unassigned numbers, users who should not be listed, and people with pending offboarding. A two-way sync can overwrite intentional exceptions or create a loop when someone changes a number manually.
We query our phone provider’s API, write the results into the standard telephoneNumber attribute in on-premises AD, and let Entra Connect synchronize the changes. The script runs on an internal server several times a day. This works well when the carrier or phone platform is the authoritative source rather than trying to maintain a two-way sync.

Related Questions
Can't Load PhpMyadmin On After Server Update
Redirect www to non-www in Apache Conf
How To Check If Your SSL Cert Is SHA 1
Windows TrackPad Gestures