I don't know VBA and am sort of muddling through. I found the following but I can't figure out why I can't pass domainObject to the ExportUsers function without getting the following error:
"Wrong number of arguments or invalid property assignment" but it works when I do this:
ExportUsers (GetObject("LDAP://" & domainContainer))
"Wrong number of arguments or invalid property assignment" but it works when I do this:
ExportUsers (GetObject("LDAP://" & domainContainer))
Code:
Sub Search()
Dim rootDSE, domainObject
Set rootDSE = GetObject("LDAP://RootDSE")
domainContainer = rootDSE.Get("defaultNamingContext")
Set domainObject = GetObject("LDAP://" & domainContainer)
ExportUsers (domainObject)
End Sub
Sub ExportUsers(oObject)
Do Stuff
End Sub