Delete all users from distribution group and then repopulate via script nightly
A CSV file is generated nightly with changes to employee positions, locations, etc. Based on this information we then add the employees to specific distribution groups. I have written a powershell script to remove all users from a distribution group and then re-add them from this CSV file. I would like to know if this will cause any replication issues throughout Active Directory by deleting all users and then adding them again? I am located at a main data center site and we have nearly 300 small sites with domain controllers. Below is a generic and simplified version of the powershell script. I would appreciate any input. -Glen- get-distributiongroupmember “DistributionGroupName” | Remove-DistributionGroupMember “DistributionGroupName” -confirm:$false import-csv C:\CSVFileName.csv | foreach {If ($_.Parameter -eq "Value" {add-distributiongroupmember -id "DistributionGroupName" -member $_.NetworkIDx}}
July 19th, 2011 5:03pm

As far i understand and as far you dont have multiple exchagne sites, Removing and adding user to DL will not make any replication issues. Exchange Server will use the DC from its own site always untile its not reachable/available. and DL expansion is happenng on Exchagne Server. nothing much to do with DC to DC replicaiton.Thanks & Regards, Sandheep [...:::""I can't do it" never yet accomplished anything; "I will try" has performed wonders ":::...]
Free Windows Admin Tool Kit Click here and download it now
July 19th, 2011 5:18pm

What are the implications of having two Exchange sites? We have Exchange Client Access, Hub Transport, and Mailbox servers at my site and one other site.
July 19th, 2011 5:51pm

On Tue, 19 Jul 2011 20:57:55 +0000, -Glen- wrote: >A CSV file is generated nightly with changes to employee positions, locations, etc. Based on this information we then add the employees to specific distribution groups. I have written a powershell script to remove all users from a distribution group and then re-add them from this CSV file. I would like to know if this will cause any replication issues throughout Active Directory by deleting all users and then adding them again? It won't cause any "issues" but it will generate a fail amount of replication traffic to the other DCs. >I am located at a main data center site and we have nearly 300 small sites with domain controllers. Below is a generic and simplified version of the powershell script. I would appreciate any input. > >-Glen- > >get-distributiongroupmember ?DistributionGroupName? | Remove-DistributionGroupMember ?DistributionGroupName? -confirm:$false import-csv C:\CSVFileName.csv | foreach {If ($_.Parameter -eq "Value" {add-distributiongroupmember -id "DistributionGroupName" -member $_.NetworkIDx}} You can do better by checking to see if the AD object in the members property is in the CSV and removing only those that aren't. Do the same for the stuff in the CSV -- if it isn't in the members property, add it. The script will be more complex than what you have now, but if the AD is capable of doing link value replication you'll only replicate the changes rather than the entire membership of the DL. Unless you have a huge "churn" in the DL membership the replication to all those other DCs will be considerably less. --- Rich Matheisen MCSE+I, Exchange MVP --- Rich Matheisen MCSE+I, Exchange MVP
Free Windows Admin Tool Kit Click here and download it now
July 19th, 2011 9:17pm

Any pointers as to how I go about doing this? I am not the strongest scripter.
July 20th, 2011 5:24pm

>>I would like to know if this will cause any replication issues throughout Active Directory by deleting all users and then adding them again? Of course, it will cause replication flow. When you rename or move a member of a group (and that member resides in a different domain from the group), the group may temporarily appear not to contain that member. The infrastructure master of the group's domain is responsible for updating the group so that it knows the new name or location of the member. Infrastructure master
Free Windows Admin Tool Kit Click here and download it now
July 20th, 2011 10:55pm

If you have exchange servers in multiple site, there will be replication issues.(if you have good bandwidth between your sites, you can ignore this. If I am not wrong normal site to site replication polling interval is 15 min) if you have 2 site and only one site have the exchange servers, as far when it concerns to DL no replciation issues. And of-course it will generate more AD replication data but that will not be an issue as long you have good bandwidth between 2 site. Consider Rich's point about adding/removing the users after checking the existing membership. Also, you can think of Dynamic Distribution List. which will automatically populate the group membership as the mails comes in. However if there is frequent mail to these DLs, i wont recommend for DDL. Thanks & Regards, Sandheep [...:::""I can't do it" never yet accomplished anything; "I will try" has performed wonders ":::...]
July 21st, 2011 12:57am

Again how do I go about scripting this via powershell so it will compare? As far as bandwidth between the two Exchange sites, yes it is sufficient. We have a 1 Gb primary and a 500 Mb secondary.
Free Windows Admin Tool Kit Click here and download it now
July 21st, 2011 2:43pm

On Tue, 19 Jul 2011 21:45:56 +0000, -Glen- wrote: >What are the implications of having two Exchange sites? We have Exchange Client Access, Hub Transport, and Mailbox servers at my site and one other site. Forget Exchange. This is an AD question. You said "we have nearly 300 small sites with domain controllers". That's a LOT of replication for very little change. --- Rich Matheisen MCSE+I, Exchange MVP --- Rich Matheisen MCSE+I, Exchange MVP
July 21st, 2011 5:25pm

On Thu, 21 Jul 2011 04:52:22 +0000, Sandheep - Trying to Understand EHLO wrote: > > >If you have exchange servers in multiple site, there will be replication issues.(if you have good bandwidth between your sites, you can ignore this. If I am not wrong normal site to site replication polling interval is 15 min) > >if you have 2 site and only one site have the exchange servers, as far when it concerns to DL no replciation issues. > >And of-course it will generate more AD replication data but that will not be an issue as long you have good bandwidth between 2 site. He said he has 300 sites, not 2, each with a DC! --- Rich Matheisen MCSE+I, Exchange MVP --- Rich Matheisen MCSE+I, Exchange MVP
Free Windows Admin Tool Kit Click here and download it now
July 21st, 2011 5:28pm

On Thu, 21 Jul 2011 18:37:33 +0000, -Glen- wrote: >Again how do I go about scripting this via powershell so it will compare? As far as bandwidth between the two Exchange sites, yes it is sufficient. We have a 1 Gb primary and a 500 Mb secondary. In general terms, you could you this as a model: Get the group membership using ADSI. That'll get you just the DNs of the members. Load it into a hash using the DN as the key and, say, "?" as the value. Using the names in your SV, get the distinguished name of each recipinet and load them into another hash. Put something into the value for each key ("?" works equally well, here). Iterate over the groups membership and for each DN, find the corresponding DN in the hash from the CSV. If it's not present, remove the DN from the group (no need to remove it from the hash). That'll take care of removing the recipients that shouldn't be there. Interate over the hash populated with the DNs from the CSV. Check each DN against the hash of the DNs from the group. If you don't find it in the hash, add it to the group. That'll take care of adding the recipients that should be in the group bu aren't. Done. --- Rich Matheisen MCSE+I, Exchange MVP --- Rich Matheisen MCSE+I, Exchange MVP
July 21st, 2011 5:36pm

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

Other recent topics Other recent topics