Programmatically add/delete users in Exchange

Posted by Terry Gamble on Server Fault See other posts from Server Fault or by Terry Gamble
Published on 2011-01-11T16:34:50Z Indexed on 2011/01/11 16:55 UTC
Read the original article Hit count: 464

Filed under:
|
|
|

I've got the following set up:

ASP.Net site that allows my internal employees to add in new hire information (no secure data, just stuff like name/address/phone) and when they submit this it goes into a database (SQL).

Every few minutes a service runs that checks the database and if there are new entries it will add them into Exchange. The issue is I'm not happy with the way the service is doing things, (It's not putting address, etc in it). As I don't have the source code this I'm thinking of recreating it.

My issue though is finding a starting point even. I know I'll have to create the scripts through code where the data is retrieved from SQL :

Joe Smith 123 Main Street Nowhere, USA 19999

And put that into a powershell cmdlet (not sure exactly the syntax but I can get that figured out unless someone already has it) where the user is created in the Active Directory as a normal user and the mailbox is created simultaneously.

From there I just need to fill out fields in Active Directory with the person's address, etc.

Finally a deletion routine for when we terminate someone, however I'm sure that it will simply be a cmdlet that is easily shelled out to much like the initial one is, once I can figure out how to start that...

Anyone have some good reference points or have already done it and can share?

© Server Fault or respective owner

Related posts about exchange

Related posts about sql