SOLVED

Microsoft Teams Phone Number Attribute in Active Directory

%3CLINGO-SUB%20id%3D%22lingo-sub-3201709%22%20slang%3D%22en-US%22%3EMicrosoft%20Teams%20Phone%20Number%20Attribute%20in%20Active%20Directory%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3201709%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20need%20to%20find%20users%20in%20Active%20Directory%20who%20have%20no%20Telephone%20number%20entry%20in%20the%20AD%20field%20but%20with%20assigned%20phone%20numbers%20in%20Teams%3F%26nbsp%3B%20I%20have%20to%20type%20the%20phone%20number%20in%20Active%20Directory%20manually.%26nbsp%3B%20I%20need%20to%20find%20a%20report%20or%20solution%2C%20so%20I%20could%20update%20our%20AD%20if%20the%20person%20in%20our%20team%20already%20assigned%20a%20phone%20number%20in%20Teams.%26nbsp%3B%20Any%20solution%20to%20this%3F%26nbsp%3B%20Thank%20you.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-3201709%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EMicrosoft%20Teams%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3202779%22%20slang%3D%22en-US%22%3ERe%3A%20Microsoft%20Teams%20Phone%20Number%20Attribute%20in%20Active%20Directory%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3202779%22%20slang%3D%22en-US%22%3EYou%20can%20generate%20a%20list%20of%20users%20with%20phone%20numbers%20assigned%20as%20detailed%20here%3A%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fmicrosoftteams%2Fsee-a-list-of-phone-numbers-in-your-organization%23using-the-teams-powershell-module%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fmicrosoftteams%2Fsee-a-list-of-phone-numbers-in-your-organization%23using-the-teams-powershell-module%3C%2FA%3E%3CBR%20%2F%3EExport%20to%20CSV%20and%20use%20the%20file%20as%20input%20for%20your%20on-premises%20objects.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3202910%22%20slang%3D%22en-US%22%3ERe%3A%20Microsoft%20Teams%20Phone%20Number%20Attribute%20in%20Active%20Directory%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3202910%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F364191%22%20target%3D%22_blank%22%3E%40Dobongsoon%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20there%20is%20no%20simple%20way%2C%20how%20about%20trying%20to%20sync%20with%20powershell%20commands.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E1.%20Get%20all%20Teams%20users%20phone%20number%26nbsp%3B%20(using%20'MicrosoftTeams'%20module)%26nbsp%3B%3C%2FP%3E%3CP%3E%24teamsUsers%20%3D%20Get-CsOnlineUser%20%7C%20Select-Object%20UserPrincipalName%2C%20LineURI%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E2.%20Compare%20phone%20number%20between%20AD%20and%20Teams.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E(Get-ADUser%20-Identity%20%24teamsUser%20-Properties%20*).Mobile%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E3.%20If%20there%20is%20difference%2C%20overwrite%20AD%20att.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%23%23%3C%2FP%3E%3CP%3EI%20didn't%20write%20the%20full%20script.%3CBR%20%2F%3EIt%20seems%20that%20it%20can%20be%20applied%20using%20the%20above%20command%20and%20foreach%20syntax.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

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.

3 Replies
You can generate a list of users with phone numbers assigned as detailed here: https://docs.microsoft.com/en-us/microsoftteams/see-a-list-of-phone-numbers-in-your-organization#usi...
Export to CSV and use the file as input for your on-premises objects.

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.

 

 

 

best response confirmed by Dobongsoon (Occasional Contributor)
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.