Click here to Skip to main content
13,295,051 members (85,697 online)
Click here to Skip to main content
Add your own
alternative version


3 bookmarked
Posted 19 Aug 2014

Active Directory Services - Email Creation

, 19 Aug 2014
Rate this:
Please Sign up or sign in to vote.
This article and tip describes how to create or delete an Active Directory Services Email using ASP.NET web page, remotely.


This article describes how to create or delete an Active Directory Services Email using ASP.NET web page, remotely. 


The whole idea is that email creation and deletion cannot be done remotely. An email only can be added or deleted from the server that holds the Active Directory Services. 


Here is what we can do: 


  • On the Active Directory Services Server or the remote computer that holds the Active Directory Services, we need to create and  install WINDOWS service 

  • This windows service holds a class that contains the following methods: 

  • CreateUserEmail ( string adsUser) 

  • String adsUser must be in the form [first name] [space] [last name] [space] [company name(OU, or organizational unit in ADS)] 

  • SecureYourString( string input ) – this method converts a regular string to secure string  

  • On the ASP.NET website, that is hosted on remote computer, away from Active Directory Services, running on local or production IIS, we have a class, name it whatever you want, that contains a method: 

  • ADS_CreateMailBox ( string firstName, string lastName, string userName, string companyOU) 

  • Inside this method we use the following two classes: 

  • System.Runtime.Remoting.RemotingConfiguration.RegisterWellKnownClientType() 

  • RemotingConfiguration.IsWellKnownClientType() 

  • And here is the trick that makes it all happen:  On Active Directory Services Server, and on the Windows Service that we created earlier over there, a reference DLL, and not Windows or Web Service reference, should be added or copied from our local ASP.NET website.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Jinan Kordab
Software Developer
Canada Canada
No Biography provided

You may also be interested in...

Comments and Discussions

GeneralMy vote of 5 Pin
Humayun Kabir Mamun19-Aug-14 23:11
memberHumayun Kabir Mamun19-Aug-14 23:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.171207.1 | Last Updated 20 Aug 2014
Article Copyright 2014 by Jinan Kordab
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid