Feb 22 2022 04:53 PM
Hi,
I need to find users in Active Directory who have no Telephone number entry in the AD field but with assigned phone numbers in Teams? I have to type the phone number in Active Directory manually. I need to find a report or solution, so I could update our AD if the person in our team already assigned a phone number in Teams. Any solution to this? Thank you.
Feb 23 2022 12:07 AM
Feb 23 2022 01:00 AM
Hi, @Dobongsoon
If there is no simple way, how about trying to sync with powershell commands.
1. Get all Teams users phone number (using 'MicrosoftTeams' module)
$teamsUsers = Get-CsOnlineUser | Select-Object UserPrincipalName, LineURI
2. Compare phone number between AD and Teams.
(Get-ADUser -Identity $teamsUser -Properties *).Mobile
3. If there is difference, overwrite AD att.
##
I didn't write the full script.
It seems that it can be applied using the above command and foreach syntax.
Thanks.
Feb 23 2022 08:06 AM
Solution@somnio0505 Thank you for the information. This confirms that there is no direct attribute between the two, and that the information lives in two different environment. I will check out the script. I appreciate the time and help on this.
Sep 02 2022 12:06 PM - edited Sep 02 2022 12:08 PM
There's a great write up here that shows exactly how to do this using the Teams Powershell Module. There's even a script provided that can connect to your teams tenant to grab the LineURIs of users and then update the AD telephoneNumber attribute:
https://goziro.com/how-to-sync-microsoft-teams-phone-numbers-with-active-directory/
Aug 27 2023 02:54 PM
Can you maybe help me creating the same type of script but then the other way around. Im looking for a way to update phonenumbers of teams users by using the on prem ad.
Kind regards,
Ismet IT
Feb 23 2022 08:06 AM
Solution@somnio0505 Thank you for the information. This confirms that there is no direct attribute between the two, and that the information lives in two different environment. I will check out the script. I appreciate the time and help on this.