Quantcast
Viewing latest article 30
Browse Latest Browse All 120

Get DL Groups user is member of in Exchange online

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 latest article 30
Browse Latest Browse All 120

Trending Articles



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