Hi Mike

Does this look ok to you ?

I have added the CHTTP tag to load the CSV file, but is the get all
users from active directory look correct ?


<!--- get the csv file --->

<CFHTTP METHOD="GET" URL="http://localhost/filename.csv";
NAME="csvQuery"> 
    
<!--- get all users from Active Directory --->

<cfldap action="query"
name="ldapResults"
attributes = "title, telephonenumber"
START="ou=main,DC=domain,dc=co,dc=uk"
scope="subtree"
server="domain"
port="389"
username="username"
password="password"
>

<cfloop query="ldapResults">
<newAttributes = "">  <!--- reset our attributes string --->

  <cfquery datasource="csvSource">  <!--- get any updated values from
the csv source --->
  SELECT *
  FROM csvQuery  <!--- this is the name of your query from the cfhttp
tag --->
  WHERE id = #ldapResults.employeeID#
  </cfquery>

  <cfif compare(ldapResults.title, csvSource.title) neq 0>  <!--- see if
anything is different --->

    <cfset newAttributes = newAttributes & "title=#csvSource#;">

  </cfif>

  <cfif compare(ldapResults.telephoneNumber, csvSource.telephoneNumber)
neq 0>  <!--- see if anything is different --->

    <cfset newAttributes = newAttributes & "title=#csvSource#;">

  </cfif>

  <cfif len(newAttributes) gt 0>  <!--- if any differences were found,
update the AD object --->


<cfldap
action="modify"
modifyType="replace"
attributes="#newAttributes#"
DN="ou=main,dc=domain,dc=co,dc=uk"
server="server"
port="389"
username="username"
password="password">
</cfif>

</cfloop>


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:300836
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to