' 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. ' This code creates a new mail-enabled group of the specified ' type. You have to specify the container and group name. ' ------ SCRIPT CONFIGURATION ------ strDCName = "" ' e.g. CONT-EXBE01 strContainer = "" ' e.g. "/CN=Users, dc=contoso, dc=local" strGroupName = "" ' e.g. "Led Zeppelin Fans" Const ADS_GROUP_TYPE_DOMAIN_LOCAL_GROUP = 4 Const ADS_GROUP_TYPE_GLOBAL_GROUP = 2 Const ADS_GROUP_TYPE_LOCAL_GROUP = 4 Const ADS_GROUP_TYPE_SECURITY_ENABLED = -2147483648 Const ADS_GROUP_TYPE_UNIVERSAL_GROUP = 8 ' ------ END CONFIGURATION --------- Set objContainer = GetObject("LDAP://" & strDCName & strContainer) Set objGroup = objContainer.Create("Group", "cn=" & strGroupName) With objGroup .Put "sAMAccountName", strGroupname .Put "groupType", ADS_GROUP_TYPE_UNIVERSAL_GROUP .MailEnable .SetInfo End with WScript.Echo "New group " & strGroupName & " created successfully"