473,378 Members | 1,429 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Crea

I'm trying to create an exchange account and mailbox using LDAP. So far I've
created the exchange account, and it looks good when viewing it in Exchange
administrator (Exchange 5.5).

How do I associate it to an active directory?
How do I set the trust level and home server as shown in the advanced tab of
the recipient dialog in exchange administrator?

Here is the code I used to create the exchange account:
DirectoryEntry pDE = new DirectoryEntry();
pDE.AuthenticationType = AuthenticationType;

pDE.Username = UserName;

pDE.Password = Password;

pDE.Path = strPath;

DirectoryEntry pNewUser = pDE.Children.Add(strSEARCH_CN + pAccount.RDN,
pDE.SchemaClassName);

if (pNewUser != null)

{

pNewUser.Properties["objectClass"].Add("organizationalPerson");

pNewUser.Properties["objectClass"].Add("person");

pNewUser.Properties["objectClass"].Add("top");

}

pNewUser.Properties["rdn"].Add("joe.smith");

pNewUser.Properties["cn"].Add("smith, joe");

pNewUser.Properties["distinguishedName"].Add("cn=joe.smith,cn=mycontainer,ou
=mysite,o=myorganization");

pNewUser.Properties["rfc822Mailbox"].Add("jo*******@mydomain.com");

pNewUser.Properties["mail"].Add("jo*******@mydomain.com");

pNewUser.Properties["company"].Add("mycompany");

pNewUser.Properties["mailPreferenceOption"].Add(0);

pNewUser.Properties["department"].Add("mydepartment");

pNewUser.Properties["givenName"].Add("joe");

pNewUser.Properties["Home-MTA"].Add("cn=Microsoft
MTA,cn=myserver,cn=Servers,cn=Configuration,ou=mys ite,o=myorganization");

pNewUser.Properties["uid"].Add("joe.smith"

pNewUser.Properties["MAPI-Recipient"].Add(true);

pNewUser.Properties["physicalDeliveryOfficeName"].Add("myofficename");

pNewUser.Properties["sn"].Add("smith");

pNewUser.Properties["title"].Add("mytitle");

pNewUser.Properties["telephoneNumber"].Add("123-1234");

pNewUser.CommitChanges();

pNewUser.Close();


Nov 17 '05 #1
0 932

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Augusto | last post by:
Ciao a tutti, premetto a tutti che stò imparando proprio adesso a studiare python ed ho il seguente problema ... questo script copiato pari pari da un tutorial mi ridà un'errore che non capisco.....
5
by: Ignacio Domínguez | last post by:
Hi. Is there a way of accessing the address book, similar to what Outlook Express does, using C#? Thanks Ignacio Domínguez
4
by: Crea-Ue. Kirdar | last post by:
hi there, i am out of ideas what to do with that eventlog-things. it seems, that the implementation of the eventlog-support in dotnet is really poor. however, here are the problems i have at the...
3
by: Chris LaJoie | last post by:
I'm looking for the framework equivilent of either the ShellExec or WinExec API. Preferably ShellExec because I can use it to launch the default browser as well as launch executables. thanks.
3
by: Patrick | last post by:
Hi I have the following problem. When starting my asp.net application, i read a encrypted string from a file, decrypt it and want this values to be available in the complete application. they...
4
by: Karl Seguin | last post by:
Some of our users behind firewalls (watchguard in particular) are reporting that they can't access our site. This is the type of error they are getting: 02/06/04 07:27 http-proxy: removing...
0
by: T-Mat | last post by:
Ciao a tutti!!!! Devo creare un'oggetto riutilizzabile che abbia le funzioni di modifica,aggiunta,eliminazione e scrittura di elementi in un file XML utilizzando il linguaggio C#. Una volta...
3
by: erikcw | last post by:
Hi, I'm getting the following error when I try to pass a list into a function. My List: crea = Traceback (most recent call last): File "wa.py", line 118, in ? curHandler.walkData()
3
by: =?Utf-8?B?cml2YWxAbmV3c2dyb3Vwcy5ub3NwYW0=?= | last post by:
I've a situation where I'm creating controls programatically. I'm programatically creating table cells and rows. I've got an array of data, and I want to format the data on screen in rows of 4. ...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.