First, make sure your username is a domain account that has access to view the IT OU in AD. If that doesn't help, then remove the filter and specify only the cn attribute.
Also, make sure you have specified a domain controller. If you have a different, working, CFLDAP tag, just use it and change the attributes, one at a time, until you get it working. It looks right, for me, but there could be just a small detail that is breaking it. I'm going to be off-line for about 4-5 hours. If you have any other problems, I can connect to an AD server later and try something else. M!ke -----Original Message----- From: Ian Vaughan [mailto:[EMAIL PROTECTED] Sent: Friday, March 24, 2006 8:57 AM To: CF-Talk Subject: RE: CFLDAP Question ? I am trying the following but it is not populating the .csv file ? Instead I am getting the following error Connection to LDAP Server failed The error occurred in cfldap10.cfm: line 11 9 : <cfldap action="query" 10 : name="adresult" 11 : attributes = "cn, mailNickname, proxyAddresses" --------------------------------------- <cfldap action="query" name="adresult" attributes = "cn, mailNickname, proxyAddresses" scope="subtree" START="ou=IT,DC=domain,dc=gov,dc=uk" filter="(&(objectClass=User)(mail=*))" server="server" port="389" username="username" password="password" > <cfset header = "cn, mailNickname, proxyAddresses"> <CFFILE ACTION="write" FILE="excel.csv" OUTPUT="#header#"> <cfset datafile = ''> <cfloop query="adresult"> <cfset datafile = adresult.cn & "," & adresult.mailNickname & "," & adresult.mailNickname> </cfloop> -----Original Message----- From: Dawson, Michael [mailto:[EMAIL PROTECTED] Sent: 24 March 2006 14:19 To: CF-Talk Subject: RE: CFLDAP Question ? I may not get all the attributes right, since I'm not connected to a server right now... <cfldap action="query" name="results" scope="subtree" base="ou=myOU,dc=domain,dc=com" attributes="cn,mailNickname,proxyAddresses" filter="(&(objectClass=User)(mail=*))" server="domcontroller" username="" password="" > That code should get you the records from AD. Since proxyAddresses is a multi-value attribute, you will need to handle those accordingly. By default, they will be comma-separated, if there are more than one value. The filter says: Any object that is a User AND also has an email address. You may need to adjust this for your needs. Then, loop over the ldap query and create your csv file using CFFILE. There were some recent cf-talk posts on using java to save data to files, in case your data is very large. M!ke -----Original Message----- From: Ian Vaughan [mailto:[EMAIL PROTECTED] Sent: Friday, March 24, 2006 6:02 AM To: CF-Talk Subject: RE: CFLDAP Question ? Hi Mike Going to use a different approach What code would I need to dump the following information from Active Directory (CN, mailnickname, ProxyAddressses) to a .CSV file for all users in a certain OU? Any ideas? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:236134 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54