find out if user is member of dynamic distribution group
hello, how can I find out if a user is member of any of my dynamic distribution groups ? kind regards, wim
July 7th, 2011 4:48am

The user wouln't be a member of the DDG, i.e the DDG is built using a filter. Therefore you will have to work backwards. Get members from DDG and filter your user. This will work with one DDG - http://social.technet.microsoft.com/Forums/en-US/exchangesvrgeneral/thread/19c6758d-0783-4a2c-bac0-2fb2b22d68c2/ Not sure how may you, if you have more than one then you will either have to do this manually for each, or modify the script to get all DDG and their memebrs. Once you've got this you can import into excel and filter out your user. Sukh
Free Windows Admin Tool Kit Click here and download it now
July 7th, 2011 5:55am

Save the filter in a variable for the Dynamic Distribution Group GroupA $a = (Get-DynamicDistributionGroup GroupA).RecipientFilter Then use the filter saved in $a as the filter argument Get-Recipient -Filter $a or combined on a single line Get-Recipient -Filter ((Get-DynamicDistributionGroup GroupA).RecipientFilter) lasse at humandata dot se, http://anewmessagehasarrived.blogspot.com
July 7th, 2011 6:09am

I like the one-line command ! but it doesn't provide solution to the question if a user x is member of any distribution group. Kind regards, Wim
Free Windows Admin Tool Kit Click here and download it now
July 7th, 2011 6:22am

Sorry, got your question backwards. Then we need to enumerate the DDL to see if the recipient matches any member. something like this. $a = Get-Recipient -Filter ((Get-DynamicDistributionGroup GroupA).RecipientFilter) $b = get-Recipient lasse foreach ($rec in $a) { if ($b -like $rec) { Write-host $b.Alias "found in DDL" } }lasse at humandata dot se, http://anewmessagehasarrived.blogspot.com
July 7th, 2011 6:58am

lasse, thank you kindly ! based upon your code, I made this script get-mailboxstatus user $op_file = $args[0] if (! $op_file) { Write-Host "Hallo, je zal me toch wat meer moeten vertellen :-)" Write-Host $op_file = Read-Host "Welke gebruiker ?" } get-mailbox | where {$_.displayname -match $op_file} | select name, ismailboxenabled,prohibit*,max* | fl get-mailboxstatistics | where {$_.displayname -match $op_file} | ft -autosize displayname,itemcount, @{expression = {$_.totalitemsize.value.tomb()}} Write-Host "mapi connectivity :" write-host "-------------------" get-mailboxstatistics | where {$_.displayname -match $op_file} | Test-MAPIConnectivity | fl get-logonstatistics | where {$_.username -match $op_file} | ft -autosize pause.ps1 Write-Host "Lid van de volgende dynamic distribution groups" Write-Host "-----------------------------------------------" $DDG = get-dynamicdistributiongroup | where {$_.recipienttype -match "DynamicDistributionGroup"} foreach ($dyngroup in $DDG) { $a = Get-Recipient -Filter ((Get-DynamicDistributionGroup $dyngroup).RecipientFilter) $b = get-Recipient $op_file foreach ($rec in $a) { if ($b -like $rec) { Write-host $b.Alias "is lid van Dynamic Distribution Group " $dyngroup.name } } } write-host "" Write-Host "Lid van de volgende mail enabled groups (maar niet de dynamic distribution groups)" Write-Host "---------------------------------------" get-group | where {$_.recipienttype -match "MailUniversalDistributionGroup"} | where {$_.members -match $op_file} | select name kind regards, wim.
Free Windows Admin Tool Kit Click here and download it now
July 7th, 2011 7:23am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics