I am outputting some details from our AD to Excel using VBS. Being unfamilier with this method, is there a way to output only Users from a certain Container?
This is how I am setting the Domain -
Set objRoot = GetObject("LDAP://RootDSE")
strDNC = objRoot.Get("DefaultNamingContext")
Set objDomain = GetObject("LDAP://" & strDNC)
I know that I can check for a User using the following code, but I don't know what to check against objDomain to check for a Container name. Thanks.
For Each objMember In objDomain
If objMember.Class = "user" {And objDomain container name = "Sherborne Users"} Then
' Code goes here
End If
Next