Platform SDK: Active Directory, ADSI, and Directory Services

ADS_GROUP_TYPE_ENUM

The ADS_GROUP_TYPE_ENUM enumeration specifies the type of group objects in ADSI.

typedef enum {
  ADS_GROUP_TYPE_GLOBAL_GROUP        = 0x00000002,
  ADS_GROUP_TYPE_DOMAIN_LOCAL_GROUP  = 0x00000004,
  ADS_GROUP_TYPE_LOCAL_GROUP         = 0x00000004,
  ADS_GROUP_TYPE_UNIVERSAL_GROUP     = 0x00000008,
  ADS_GROUP_TYPE_SECURITY_ENABLED    = 0x80000000
  } ADS_GROUP_TYPE_ENUM;

Elements

ADS_GROUP_TYPE_GLOBAL_GROUP
Group that contains only accounts and other account groups from its own domain. This group may be exported to a different domain.
ADS_GROUP_TYPE_DOMAIN_LOCAL_GROUP
Group that can contain accounts and universal groups from any domains. It may not be included in either access-control lists of resources in other domains or groups other than global groups in the same domain.
ADS_GROUP_TYPE_LOCAL_GROUP
This flag is for the WinNT provider as the ADS_GROUP_TYPE_DOMAIN_LOCAL_GROUP flag is for the LDAP provider.
ADS_GROUP_TYPE_UNIVERSAL_GROUP
Group that can contain accounts and account groups from any domains, but not domain local groups.
ADS_GROUP_TYPE_SECURITY_ENABLED
Group that is security enabled. This group can be used to apply an access-control list on an ADSI object or a file system.

Remarks

Note  Because VBScript cannot read information from a type library, VBScript applications do not understand the symbolic constants as defined above. You should use the numerical constants instead to set the appropriate flags in your VBScript applications. If you want to use the symbolic constants as a good programming practice, you should make explicit declarations of such constants, as done here, in your VBScript applications.

Example Code [Visual Basic]

The following code snippet illustrates how you might use elements of this enumeration.

Dim rootDSE As IADs
Dim dom As IADsContainer
Dim grp As IADs
 
 
Set rootDSE = GetObject("LDAP://RootDSE")
Set dom = GetObject("LDAP://" & rootDSE.Get("defaultNamingContext"))
 
'Creating Secured Global Group
Set grp = dom.Create("group", "CN=group1")
grp.Put "samAccountName", "group1"
grp.Put "groupType", ADS_GROUP_TYPE_GLOBAL_GROUP Or ADS_GROUP_TYPE_SECURITY_ENABLED
grp.SetInfo
 
 
'Creating Distribution List Local Group
Set grp = dom.Create("group", "CN=group2")
grp.Put "samAccountName", "group2"
grp.Put "groupType", ADS_GROUP_TYPE_DOMAIN_LOCAL_GROUP
grp.SetInfo
 
'Create Secured Universal Group (ONLY IN NATIVE MODE)
Set grp = dom.Create("group", "CN=group3")
grp.Put "samAccountName", "group3"
grp.Put "groupType", ADS_GROUP_TYPE_UNIVERSAL_GROUP Or ADS_GROUP_TYPE_SECURITY_ENABLED
grp.SetInfo

Requirements

  Windows NT/2000: Requires Windows 2000 (or Windows NT 4.0 with DSClient).
  Windows 95/98: Requires Windows 95 or later (with DSClient).
  Header: Declared in Iads.h.

See Also

ADSI Enumerations