I don't understand why the following code works:
All the documentation online says that I should use this syntax:
Where do I find a list of the properties I can retrieve using the first example? Using example 1 syntax, I can't seem to access all of the object attributes from AD (Such as canonicalName)
Thanks in advance!
PSC
Governments and corporations need people like you and me. We are samurai. The keyboard cowboys. And all those other people out there who have no idea what's going on are the cattle. Mooo! --Mr. The Plague, from the movie "Hackers
Code:
Option Explicit
Dim strDN, member, objGroup
strDN = "CN=Domain Admins,CN=Users,DC=domain,DC=tld"
Set objGroup = GetObject("LDAP://" & strDN)
WScript.Echo "sAMAccountName: " & objGroup.sAMAccountName
WScript.Echo "cn: " & objGroup.cn
WScript.Echo "description: " & objGroup.description
WScript.Echo "members: "
For Each member In objGroup.members
WScript.Echo " " & member.distinguishedName
Next
All the documentation online says that I should use this syntax:
Code:
Option Explicit
Dim strDN, member, objGroup
strDN = "CN=Domain Admins,CN=Users,DC=domain,DC=tld"
Set objGroup = GetObject("LDAP://" & strDN)
WScript.Echo "sAMAccountName: " & objGroup.Get("sAMAccountName")
WScript.Echo "cn: " & objGroup.Get("cn")
WScript.Echo "description: " & objGroup.Get("description")
WScript.Echo "members: "
For Each member In objGroup.GetEx("member")
WScript.Echo " " & member
Next
Where do I find a list of the properties I can retrieve using the first example? Using example 1 syntax, I can't seem to access all of the object attributes from AD (Such as canonicalName)
Thanks in advance!
PSC
Governments and corporations need people like you and me. We are samurai. The keyboard cowboys. And all those other people out there who have no idea what's going on are the cattle. Mooo! --Mr. The Plague, from the movie "Hackers