Quantcast
Channel: Exchange Server 2010 forum
Viewing all articles
Browse latest Browse all 19572

problems comparing distribution groups

$
0
0

I'm having an issue with comparing a couple of distribution groups.  I've got a static Distribution group synced from AD to Exchange Online called All_Associates.  I've got a dynamic distribution group created that using the following logic.

(RecipientType -eq 'UserMailbox') -and (RecipientTypeDetails -eq 'UserMailbox') -and (CustomAttribute1 -ne 'Terminated')

The idea is to create a dynamic group of all user mailboxes to replace the static All_Associates with.  The CustomAttribute1 is a value we add to remove a user from all their dynamic groups pending the complete archiving and closing of their account and services.

To view the potential members of the dynamic list, called DDGTEST, I have a function called get-distributiongroupmembers (get-ddgmember).  Below is the code.

function get-dynamicdistributiongroupmember ($dgname)
{
$DDG = Get-DynamicDistributionGroup $dgname
Get-Recipient -RecipientPreviewFilter $DDG.RecipientFilter
}

To proof the logic I run both groups through a compare-object with the static group being the reference.

compare $(get-distributiongroupmember all_associates) $(get-ddgmember ddgtest)

The result is about a dozen names show up as being in the dynamic group but not in the static group.

I output the memberships of the groups to files alphabetically and compare the lists the users that the compare cmdlet returned are listed in both groups, contrary to what the compare-object cmdlet returns.

I'd really like to get this dynamic groups live and on paper it SHOULD be working and it may very well be working but I'm not comfortable putting it in to production use until I've figured out what is going on.  There are over 100 users in the group so I tacked a -resultsize switch in to the compare cmdlet for the static group and I get the same results.

Any thoughts?  I'm fairly new at powershell and this has be a bit stumped.


Viewing all articles
Browse latest Browse all 19572

Trending Articles



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