Retrieve Distribution Group Memberships for users in a CSV

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

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.
2,878 questions
{count} votes

Accepted answer
  1. answered 2021-04-28T06:45:33.267+00:00
    Vasil Michev 61,446 Reputation points Microsoft MVP

    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.

    No comments

1 additional answer

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

    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

    No comments