List All the inetOrgPersons in an ADAM OU

Lists all the inetOrgPerson accounts in an ADAM OU named Accounting.

VBScript Code


On Error Resume Next

Set objOU = GetObject("LDAP://localhost:389/ou=Accounting,dc=fabrikam,dc=com")
objOU.Filter = Array("inetOrgPerson")

For Each objUser in objOU
    Wscript.Echo objUser.Name
Next