Listing 1

<!---a boolean variable to hold the logged in state of the user--->
<cfset isLoggedIn = false>
<cfset baseDomain = '@bankx.com'> 
<cfset domainController = 'server_IP_address_server_name'>

<!---perform the authentication via CFLAP. Store the returned query in ADResult--->
<cftry>
<cfldap action="Query"
	name="ADResult"
	attributes="cn,mail,displayname,dn,memberof,extensionAttribute1,employeeID,
	sAMAccountName"
	start="cn=users,dc=bankx,dc=com"
	filter="(&(objectclass=user)(samaccountname=#ReplaceNoCase(form.username,
	baseDomain,'')#))"
	server="#domainController#"
	scope = "subtree"
	username="#form.username#"
	password="#form.password#"
>
<cfset isLoggedIn = true> 
<cfcatch>
	<cfset isLoggedIn = false>
</cfcatch>
</cftry>