Download a Tenant Directory for Access Control Purposes

Evan Becker 0 Reputation points
2024-07-09T19:00:59.37+00:00

Our Access Control company would like to programmatically download a list of tenants that are registered to a property on a regular basis. This data would be input into our system to add/remove access credentials for the tenants of the property. The data would need to include, name, email, phone, and access permissions (if applicable).

Can someone point me in the right direction of how to achieve this or how to get in contact with someone at microsoft to discuss building the solution?

Active Directory
Active Directory
A set of directory-based technologies included in Windows Server.
6,671 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
22,218 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Vahid Ghafarpour 21,800 Reputation points
    2024-07-09T20:14:15.7766667+00:00

    Thanks for posting your question in the Microsoft Q&A forum.

    You can call the Microsoft Graph API endpoints (e.g., /users, /groups, etc.) to retrieve tenant information.

    ** Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful **

    0 comments No comments

  2. Akhilesh Vallamkonda 10,325 Reputation points Microsoft Vendor
    2024-07-10T13:57:10.52+00:00

    Hi @Evan Becker
    Thank you for reaching us!

    Use below steps to pull the list of all users with the properties that you are looking for,

    • Open Windows PowerShell as administrator.
    • Run below commands
    • Install-Module AzureAD
    • Import-Module AzureAD
    • Connect-AzureAD (Enter the global admin credentials when it prompts for credentials)
    • Run the command "Get-AzureADUser -All $true | select UserPrincipalName, usertype | Export-Csv c:\Users.csv"

    Note: In the last command you can change the properties as per your requirement. This command will pull list of all users from Azure AD you are connected to.

    Let me know if you have any further questions on this.
    Thanks,

    Akhilesh.


    If this answers your query, do click Accept Answer and Yes for was this answer helpful. And, if you have any further query do let us know.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.