简体   繁体   中英

required help to fetch list of users from Azure AD using "Get-AzureADUser"

Can anyone help me with this?

I have a list of email IDs located in my D:\Script\userlist.txt(1000+ Users) . I would like to get their user principal ID/Location ID and email ID from Azure AD (For those 1000 users alone since we have a lot of users present in AD) using the PowerShell command.

I have tested in my environment.

You can use the below PowerShell command to get the list of Azure AD users details from the user's email:

Get-Content ' D:\Script\userlist.txt' | ForEach-Object {Get-AzureADUser -Filter "mail eq '$_'" | select userPrincipalName,mail,usageLocation} | export-csv ' D:\scripts\your.csv'

在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM