Hello everyone. Today’s article shows how to list contact information for authentication of all Microsoft Entra ID users using PowerShell. This article arose from the need to identify which user had the contact of a corporate mobile device that was receiving verification codes without being requested.
Connecting to Microsoft Online Services
Open PowerShell as an administrator.
If you do not have the Microsoft Online module installed, run the command below:
Install-Module Microsoft.Graph
Now let’s connect to the Microsoft Online Service by running the command below:
Connect-MgGraph
To view the phone numbers of all users who have registered their device in the tenant, use credentials with administrative access to Microsoft Entra ID.
Listing User Information
Let’s list the user information by running the following command:
Get-MgUserAuthenticationPhoneMethod | select DisplayName, PhoneNumber | ft DisplayName, PhoneNumber
As shown in the figure below, the authentication contact information is displayed, allowing the administrator to identify which user is requesting two-factor authentication by phone for the desired number.
Note: Users who have not registered their contact for secure authentication will not be listed.
With the user identified, the phone contact can be updated through the Authentication methods menu available in the user settings.
Summary
In today’s article, we showed how to locate the contact information for two-factor authentication for all users in Microsoft Entra ID using PowerShell.
Did you find this article helpful? Consider showing your appreciation by liking and sharing it. 🙂
Disclaimer: The views expressed in this post are personal and do not represent the opinions of my organization. The provided solution is offered “AS IS” without warranties or guarantees and should be validated in a test environment before deployment in production.
Your suggestions and feedback are invaluable; feel free to leave a comment.
[ ]’s Ulysses Neves
