Script creation of dynamic distribution groups based on OU description
Hi, I'm looking for a way to script the creation of hundreds of dynamic distribution groups, which apply to all users within particular OUs. The catch is that I need the name and alias of the group to be taken from the description of the OU. Any ideas?
July 22nd, 2010 9:12am

Have you tried the following link out. The only thing you will probably need to do is run import-csv where the csv will be populated with the DG names and OU to will be assign to etc. http://technet.microsoft.com/en-us/library/aa996561(EXCHG.80).aspx
Free Windows Admin Tool Kit Click here and download it now
July 22nd, 2010 1:38pm

Just forgot to mention when you run the import-csv you will need to run something like below import-csv c:\test.csv | forearch{new-dynamicdistributiongroup -name $_.name -organizationalunit $_.OU -recipientfilter {recipienttype -eq "usermailbox"}}
July 22nd, 2010 1:42pm

Just forgot to mention when you run the import-csv you will need to run something like below import-csv c:\test.csv | forearch{new-dynamicdistributiongroup -name $_.name -organizationalunit $_.OU -recipientfilter {recipienttype -eq "usermailbox"}} Just want to share few comments: -organizationalunit parameter is for placing the Dynamic DG in AD, and -RecipientContainer is used for the inclusion of members for DDG. IF u don't mention "-RecipientContainer" then all objects from "organizationalunit" u mentioned will be member of DDG based on your recipient filter. If you want to put DDG in some other OU and want to include memebrs from some other OU then use the command: New-DynamicDistributionGroup -name TestDDG1 -IncludedRecipient 'MailboxUsers' -RecipientContainer "ADDOmain.com/Members-OU" -OrganizationalUnit "ADDomain.com/DDG-OU" For details plz have a look into: http://technet.microsoft.com/en-us/library/bb125127(EXCHG.80).aspx Note: IF u mention IncludedRecipient then u cant mention "RecipientFilter" in your command. Other options for IncludedRecipient are "AllRecipients, Resources, MailContacts, MailGroups, Mail Users, and None". Regards, Laeeq Qazi|Team Lead(Exchange + Sharepoint + BES + DynamicsCRM) www.HostingController.com
Free Windows Admin Tool Kit Click here and download it now
July 22nd, 2010 2:35pm

On Thu, 22 Jul 2010 06:12:30 +0000, crazyjockey wrote: >I'm looking for a way to script the creation of hundreds of dynamic distribution groups, which apply to all users within particular OUs. The catch is that I need the name and alias of the group to be taken from the description of the OU. Any ideas? If you know the distinguishedName of the OU you can use ADSI to get the other properties of the AD object. From that you can extract what you need. $dn = "ou=aaa,dc=bbb,dc=ccc" $obj = [ADSI]("LDAP://" + $dn) $desc = $obj.description --- Rich Matheisen MCSE+I, Exchange MVP --- Rich Matheisen MCSE+I, Exchange MVP
July 23rd, 2010 5:14am

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

Other recent topics Other recent topics