Platform SDK: Active Directory, ADSI, and Directory Services |
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;
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.
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
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.