Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When setting up a new email, the user is directed to a blank address list (so they cannot access other users email addresses). This is done manually using ADSIedit.

However, there are a lot of new emails to set up. How can I create an LDAP script for exchange server (to edit active directory)?

share|improve this question
What's the purpose? Why do you want them to have a blank address list? – joeqwerty Sep 9 '10 at 12:00
@joeqwerty: yes they should have a blank address list. Basically hundreds of new addresses need to be added every year, and the new addresses should have blank address lists. – RogerMeller Sep 9 '10 at 12:11
I'm not understanding why they need blank address lists? Can you explain that? Thanks. – joeqwerty Sep 9 '10 at 12:56

As Christian said, Perl-LDAP can help, but I think that if you're using AD (rather than OpenLDAP) and are running Windows, Powershell or VBScript are going to save you the steps of needing to explicitly bind to LDAP.

The Script Center Repository will have a lot of examples, and the Microsoft Technet Script Center has loads of articles and tuturoials

share|improve this answer

Perl-Ldap can help you. There are a lot of good examples, so it is easy to start.

share|improve this answer

If you are going to be binding to ActiveDirectory, then the DirectoryServices library included with .NET has a very nice object known as a DirectoryEntry for handling users and other AD objects. It is more AD-centric than LDAP-centric (although it does use the AD-LDAP syntax) and it's just what you are looking for. You can use C#, VB.NET or any of the other .NET-aware languages to write a nice tool that will add the mail entries for you. With AD I would definitely look to use a .NET-based solution rather than more traditional Unix-style LDAP tools. There is quite a bit of good documentation out there via your favorite search engine regarding the use of DirectoryEntry for type of thing you are trying to do.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.