Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

Active Directory Services - Email

0.00/5 (No votes)
19 Aug 2014 2  
This article describes how to create or delete an Active Directory Services Email using ASP.NET web page, remotely.

Introduction

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

Background

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.

Using the code

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.

 

 

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here