If you are using an LDAP request (not sure if you need the server name there in your case):
<LDAP://SERVERNAME/DC=bobdom,DC=net>;(&(objectClass=user)( mail=mike.spencer@kenblanchard.com ));
Trying this in my own environment, it looks like this (with a couple of things generalized):
<LDAP://SERVERNAME/DC=bobdom,DC=net>;(&( mail=email@company.com ));name,mail,member,description,memberOf,userParameters,userAccountControl,whenCreated,CN;subTreeCount=1
And the whole batch looks like this (in ASP, if in the .vbs file you only need to change Server.CreateObject to CreateObject ... I think).
Set oCon = Server.CreateObject("ADODB.Connection") oCon.Provider = "ADsDSOObject" oCon.Open "ADProvider", "ADUsername", "ADPassword" Set oCmd = Server.CreateObject("ADODB.Command") Set oCmd.ActiveConnection = oCon sQuery = "<LDAP://SERVERNAME/DC=bobdom,DC=net>;(&( mail=email@company.com ));name,distinguishedName,physicalDeliveryOfficeName;subTreeCount=1>" oCmd.CommandText = sQuery Set ADRecordSet = oCmd.Execute
You may need to play with subTreeCount .
source share