Quantcast
Channel: Active questions tagged powershell-3.0 - Stack Overflow
Viewing all articles
Browse latest Browse all 120

Get DL Groups user is member of in Exchange online

$
0
0

I'm trying to get the list of DL groups user is member of in O365. I'm using below PS Script but I'm getting the error message.

$user = "test1@rtest.com"$dlGroups =Get-DistributionGroup | Get-DistributionGroupMember | Where-Object {$_.PrimarySmtpAddress -eq $userEmail}foreach($dl in $dlGroups){ Write-Output $dl#Remove-DistributionGroupMember -Identity $dl.Identity -Member $user}

error:

Write-ErrorMessage : ||The operation couldn't be performed because 'Bus Training School' matches multiple entries.

Viewing all articles
Browse latest Browse all 120

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>