' This script was originally published in the Exchange Cookbook, ' (http://www.exchangebookcook.com). Written by Paul Robichaux, ' Missy Koslosky, and Devin Ganger. Redistributed with permission ' of the publisher, O'Reilly & Associates. ' ------ SCRIPT CONFIGURATION ------ strDCName = "" ' e.g. "CONT-EXBE01" strContainer= "" ' e.g. "CN=users,dc=robichaux, dc=net" strQDGName = "" 'e.g. "Mail Users" strDomain = "@" ' e.g. "@robichaux.net" strFilter = "(&(!cn=SystemMailbox{*})(& (mailnickname=*) (| (&(objectCategory=person)(objectClass=user)(|(homeMDB=*)(msExchHomeServerName=*))) )))" ' ------ END CONFIGURATION --------- Set objContainer = GetObject("LDAP://" & strDCName & "/" & strContainer) Set objQDG = objContainer.Create("msExchDynamicDistributionList", "CN=" & strQDGName) With objQDG .Put "msExchDynamicDLFilter", strFilter .Put "displayName", strQDGName .Put "mailNickname", strQDGName .Put "reportToOriginator", True .Put "proxyAddresses", "SMTP:" & strQDGName & strDomain .Put "legacyExchangeDN", "/o=/ou=First Administrative Group/cn=Recipients/cn=" & strQDGName ' e.g. "/o=First Organization (Exchange)/ou=First Administrative Group/cn=Recipients/cn=" & strQDGName .put "msExchDynamicDLBaseDN", strContainer .Put "systemFlags", 1610612736 .SetInfo End With wscript.echo "Created QDG " & strQDGName