Assuming you have variables named ldapserver, ldapuser, and ldappassword ... 
This should work

<cffunction name="add_member_group" output="false" hint="Adds a user to the 
membership of a Domain Group.">
                <cfargument name="username" type="string" required="yes" 
hint="The Username to be added to the group">
                <cfargument name="groupname" type="string" required="yes" 
hint="The Group to which the user should be added">
                <cfargument name="start" type="string" required="yes" hint="The 
ldapstart route">
                
                <cfset var userquery= "" />     
                <cfset var groupQuery= "" />    
                                        
                <!--- Get the Dn for the user --->
                <cfldap action="QUERY" name="userquery"
                                                                attributes="dn" 
start="#arguments.start#" scope="SUBTREE" maxrows="10000"       
                                                                
filter="samaccountname=#arguments.username#"
                                                                
server="#ldapserver#" username="#ldapuser#" password="#ldappassword#" />
                
                <!--- Get the Dn for the group --->
                <cfldap action="QUERY" name="groupQuery" 
                                                                attributes="dn, 
member" start="#arguments.start#"
                                                                scope="SUBTREE" 
maxrows="10000" filter="samaccountname=#arguments.groupname#"
                                                                
server="#ldapserver#" username="#ldapuser#"     password="#ldappassword#" /> 
                
                <!--- Add the user to the group --->
                <!--- separator=";"  Allows the commna laden dn to be passed 
through this command, as the default separator is a comma. --->
                <cfldap action="modify" dn="#groupQuery.dn#" 
attributes="member=#userquery.dn#" separator=";" modifytype="add"
                                server="#ldapserver#" username="#ldapuser#"     
password="#ldappassword#" />
                                        
</cffunction>

Terrence Ryan
Senior Systems Programmer
Wharton Computing and Information Technology       
E-mail:         [EMAIL PROTECTED]



-----Original Message-----
From: Michael Bondar [mailto:[EMAIL PROTECTED] 
Sent: Thursday, February 08, 2007 5:07 PM
To: CF-Talk
Subject: Re: Updating MSExchange PDL using CFLDAP tag

Tarrence,

You are correct. PDL stands for "Public Distribution List"
I do not have permissions to add a group to the user's record, but I do have 
permission to add a user to a PDL. That's what I need to do using ColdFusion.

Thanks,
Michael



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Upgrade to Adobe ColdFusion MX7 
Experience Flex 2 & MX7 integration & create powerful cross-platform RIAs 
http:http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU

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

Reply via email to