?
Solved

Edit Exchange DL with LDAP & ADO

Posted on 2003-03-12
5
Medium Priority
?
466 Views
Last Modified: 2012-08-13
I was asked by a client this morning if it was possible to EDIT a Distribution List on Exchange 2000.  I can use LDAP with ADSI to get the users of a DL with this;

strADOQueryString = "<LDAP://" & strExcSrv & ">;(&(objectClass=groupOfNames)(cn=" & StrDistListName & "));*"

Set objRS = ADOconn.Execute(bstrADOQueryString)

'create distribution list object from the first field of the array
Set objObject = GetObject(objRS.Fields(0))

'member is a multiple valued field
objMembers = objObject.GetEx("member")

But what about Adding or Deleting members of the DL with ASP?
0
Comment
Question by:mgfranz
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
5 Comments
 
LVL 7

Expert Comment

by:lavinder
ID: 8125611
hi mgfranz

 i think you can use putex method to add a member to a DL object.

 objObject.PutEx ADS_PROPERTY_APPEND, "member", Array("membername" )  
 objObject.SetInfo
 
these are property codes:

ADS_PROPERTY_CLEAR
Instructs the directory service to remove the property value(s) from the object.
ADS_PROPERTY_UPDATE
Instructs the directory service to replace the current value with the element(s) in the passed VARIANT array.
ADS_PROPERTY_APPEND
Instructs the directory service to append the new value(s) to the existing one(s).
ADS_PROPERTY_DELETE
Instructs the directory service to delete the specified value(s) of a property.

hope this helps!!

0
 
LVL 18

Author Comment

by:mgfranz
ID: 8128045
I will be doing some testing today, (hopefully)...  I think what might work better would be the use of .Put and of course .Setinfo.  But the question comes up, will PutEx or Put Create a new member?  I don't think so...
0
 
LVL 18

Accepted Solution

by:
mgfranz earned 0 total points
ID: 8128219
Hey I think I found it... at least this works in 5.5.  I dunno about 2000;

DLpath = "LDAP://Spock/cn=ExchSDK,cn=Recipients,ou=Earth,o=Federation"
User="LDAP://Spock/cn=DougS,cn=Recipients,ou=Earth,o=Federation"

Set DL = GetObject(DLpath)
if DL.IsMember(User) Then  'IADsGroup IsMember method
  '  response accordingly
Else
 DL.Add(User)              ' IADsGroup Add method
End If

Set DL = Nothing
Set User = Nothing

0
 
LVL 58

Expert Comment

by:Gary
ID: 9350312
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

PAQ'd and pts refunded

Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
GaryC123
EE Cleanup Volunteer
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question