SOLVED

O365 Report | Groups users belong to

Brass Contributor

Hi,

 

I need to generate an excel list with users and the corresponding groups they belong to like:

user1,group1,group2,group3

user2,group1,group4

....

How can I get this?

 

Thanks/Brgds

joao

4 Replies
best response confirmed by Joao Casqueiro (Brass Contributor)
Solution
There are plenty such scripts available online, find the one that best suits your needs and modify it as needed. Here's one of mine: https://www.michev.info/Blog/Post/2250/generating-a-report-of-users-group-membership-memberof-invent...
Hi Vasil,
I got the following error:

PS C:\temp> .\GroupMembership

PowerShell credential request
Enter your credentials.
User: xxxxxxxxxxxxxxxxxxxxx
Password for user joao.casqueiro@cascais.onmicrosoft.com: ****************

WARNING: The names of some imported commands from the module 'tmp_ezdrmpwi.sjb' include unapproved verbs that might make them less discoverable. To find the commands with unapproved verbs, run the Import-Module command again with the Verbose parameter. For a list of approved verbs, type Get-Verb.
Get-Recipient: The operation couldn't be performed because object 'gosho' couldn't be found on 'VI1P193A001DC06.EURP193A001.PROD.OUTLOOK.COM'.
Write-Error: C:\temp\GroupMembership.ps1:124
Line |
124 | Get-DGMembershipInventory @PSBoundParameters -OutVariable global:varD …
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| No users of the specifyied types were found, specify different criteria.

PS C:\temp>

Can you help?

Thanks/Brgds
joao
Uh, that's on me, seems I forgot to clean up the script after doing some tests. You can remove "gosho" from line 78, or just redownload the updated script version.
1 best response

Accepted Solutions
best response confirmed by Joao Casqueiro (Brass Contributor)
Solution
There are plenty such scripts available online, find the one that best suits your needs and modify it as needed. Here's one of mine: https://www.michev.info/Blog/Post/2250/generating-a-report-of-users-group-membership-memberof-invent...

View solution in original post