WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Samples from Users

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

ADSI List Group Names and Email Property


http://msdn.microsoft.com/library/en-us/adschema/ad/win2k_c_group.asp?frame=true
AddExtender("WWADS34I.DLL")
sAdsiPath="LDAP://rootDSE"
sValue=dsGetProperty(sAdsiPath,"defaultNamingContext") 
sDomainDNS=StrCat("LDAP://",sValue)
domain=dsGetProperty("LDAP://rootDSE","defaultNamingContext")
;grab list of groups
sResult = dsFindPath(sDomainDNS, "(objectCategory=group)")
;For Each group
For x = 1 to ItemCount(sResult,@tab)
	 sAdsiPath = ItemExtract(x,sResult,@tab)
	 sAMAccountName = dsGetProperty(sAdsiPath, "sAMAccountName")
	 mail = dsGetProperty(sAdsiPath, "mail")
	 Message(StrCat("sAMAccountName = ",sAMAccountName),StrCat("Mail = ",mail))
Next

Article ID:   W15822
File Created: 2004:03:30:15:41:00
Last Updated: 2004:03:30:15:41:00