none
Querying Exchange Server 2010 in .NET - Do I really have to use Powershell?? RRS feed

  • Question

  • OK so I would like to look at developing software that can query an Exchange 2010 server and get things like general configuration information of the server and a list of mailboxes and details from each of them (such as size, alias, last login, etc). So I thought this should be easy in .NET what with the EWS Managed API... but it turns out this doesn't seem to be the case. It looks like the EWS Managed API is more for doing things within a mailbox like reading emails and deleting folders etc (in fact it seems more like an Outlook API than an Exchange Server API) so I can't use that - please correct me if I'm wrong though.

    So I looked into how I would go about accessing general Exchange server management information and it seems like the ONLY way is via Powershell, with the recommendation for .NET developers being to call the powershell cmdlets and work on the PSObject type objects that are sent back... which frankly is absolutely horrible as a .NET developer. You lose most of the benefits of having a strongly typed managed language, and it feels like I'm developing against some third party software that was never created with .NET in mind, not a popular modern Microsoft technology.

    Please please tell me I'm missing something and that there is a proper .NET way of doing this.

    Thanks

    Chris


    My website (free apps I've written for IT Pro's) : www.cjwdev.co.uk My blog: cjwdev.wordpress.com

    Tuesday, April 10, 2012 9:03 AM

Answers

  • So I guess I'll take that as a "no you have to use powershell" then... Looks like I won't be developing any Exchange management/reporting apps then :(

    I'm sure powershell is great for people wanting to script and automate exchange management tasks, but for the love of god please don't force .NET developers to use it through generic PSObject objects that lose all of the benefit of a strongly typed language, especially when all those powershell cmdlets do is call .NET code anyway! I found developing against Lotus Notes/Domino from .NET a better experience, and surely that should never be the case when using Microsoft's primary programming languages to develop against Microsoft's email server...


    My website (free apps I've written for IT Pro's) : www.cjwdev.co.uk My blog: cjwdev.wordpress.com

    • Marked as answer by Chris128 Thursday, April 12, 2012 8:50 AM
    Thursday, April 12, 2012 8:49 AM

All replies

  • OK so I eventually stumbled upon this reference: http://msdn.microsoft.com/en-us/library/ff326163(v=exchg.140).aspx

    But there are no examples of how to use any of the hundreds of classes in here and I get the impression you're not really meant to do it this way


    My website (free apps I've written for IT Pro's) : www.cjwdev.co.uk My blog: cjwdev.wordpress.com

    Tuesday, April 10, 2012 12:01 PM
  • So I guess I'll take that as a "no you have to use powershell" then... Looks like I won't be developing any Exchange management/reporting apps then :(

    I'm sure powershell is great for people wanting to script and automate exchange management tasks, but for the love of god please don't force .NET developers to use it through generic PSObject objects that lose all of the benefit of a strongly typed language, especially when all those powershell cmdlets do is call .NET code anyway! I found developing against Lotus Notes/Domino from .NET a better experience, and surely that should never be the case when using Microsoft's primary programming languages to develop against Microsoft's email server...


    My website (free apps I've written for IT Pro's) : www.cjwdev.co.uk My blog: cjwdev.wordpress.com

    • Marked as answer by Chris128 Thursday, April 12, 2012 8:50 AM
    Thursday, April 12, 2012 8:49 AM