Avatar of jamiepryer
Flag for United Kingdom of Great Britain and Northern Ireland

asked on 



im playing with various scripts, that use an LDAP link to AD to display information on users.

I wanted to know if there is a list somewhere of all the different properties for objectrecordset.fields for users?

for example, in the below example, i wanted to add in the users first name and surname to the code, but im not sure what these fields are called?!
im interested to know what the reference eg ("name") is for all the different fields in AD, so i can use them for different scripts, like telephone number or location etc..etc..
On Error Resume Next
Set objConnection = CreateObject("ADODB.Connection")
Set objCommand =   CreateObject("ADODB.Command")
objConnection.Provider = "ADsDSOObject"
objConnection.Open "Active Directory Provider"
Set objCommand.ActiveConnection = objConnection
objCommand.Properties("Page Size") = 1000
objCommand.CommandText = _
    "<LDAP://dc=fabrikam,dc=com>;(&(objectCategory=User)" & _
Set objRecordSet = objCommand.Execute
Do Until objRecordSet.EOF
    Wscript.Echo objRecordSet.Fields("Name").Value

Open in new window

VB Script

Avatar of undefined
Last Comment

8/22/2022 - Mon