Tell me more ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
share|improve this question

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.