Retrieve Distribution Group Memberships for users in a CSV

shaikh shoaib 171 Reputation points
2021-04-28T01:18:25.51+00:00

I have a list of 1000+ users (Name property) in CSV in which I need to extract the distribution lists each user is member of.
Wondering if I can get some suggestions for a Power Shell script.
Will need a single line output per user.
Thanks in advance.

Microsoft Exchange Online Management
Microsoft Exchange Online Management
Microsoft Exchange Online: A Microsoft email and calendaring hosted service.Management: The act or process of organizing, handling, directing or controlling something.
4,177 questions
{count} votes

Accepted answer
  1. Vasil Michev 95,341 Reputation points MVP
    2021-04-28T06:45:33.267+00:00

    There are dozens such scripts available online, do a search and find the one that best suits your needs. If you need someone to write the script for you, there are sites for that as well, don't expect people to respond to script requests here.

    Here's a sample script I wrote a while back: https://www.michev.info/Blog/Post/2250/generating-a-report-of-users-group-membership-memberof-inventory
    Feel free to modify it to take input from a CSV file. Also, don't use Name as the input value, as you can have multiple matching objects in the directory. Use a proper globally unique identifier such as UPN or PrimarySMTPAddress.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. shaikh shoaib 171 Reputation points
    2021-04-29T07:57:15.313+00:00

    Thanks we decided not go to for this atm, as running script for 1000+ over 6000+ group might cause the script to fail, or timeout, thanks anyway

    0 comments No comments