Exchange ews api, list all users - exchange-server

I am trying to retrieve all users of an exchange server using EWS API, as this answer suggested, it's possible to do with powershell. However, I will need perform this task to many servers, running the script in each server is very time consuming, configuring remote EMC seemed not easy either.
So, I am thinking of implement this with C#, looping through each server and retrieve user list and save it in a database. But I couldn't find the EWS equivalent to "Get-Mailbox"
powershell command?
What should I do with this situation?

You can use PowerShell cmdlets with C# applications. There is a short example of using cmdlets with Exchange in the Exchange Management Shell SDK.

Related

Is there a way to connect to Exchange Online using Logic Apps? Do I need to use a REST-api or EWS?

i'm quite new to Logic Apps. I got the task to make an auto reply function within Logic Apps that integrates with Exchange Online. Now I already performed this task using Outlook, but I have to be able to apply it to multiple mailboxes or even the entire company using Exchange. I'm about to get access to the Exchange Admin Center soon, but I don't really know how to start due to the fact that there is no simple way to make a connection to Exchange using Logic Apps. After some research, I think it's necessary for me to somehow make use of a REST API (I also read about the use of Exchange Web Services) to get the information I need, but my knowledge about this is quite small. I guess I'm gonna have to use a program like Postman to request information, so that I can start creating Custom Connectors to Exchange. If anybody has some understanding about this, feel free to reply and help me out! I will forever be gratefull!
There are several different approaches you could take to this if you (or probably they in your case) want your logic app to do all the work then you should use the Graph API rather then EWS (while its possible because its older API you'll loose marks on your assignment) have a look at http://martink.me/articles/using-microsoft-graph-in-logic-apps which covers the basics of what to do. To Get access to mailboxes tenant wide then you need to assigned Application Permission and get certificate (and store that in the KeyVault on Azure etc).
You can do this using Inbox Rules https://learn.microsoft.com/en-us/graph/api/mailfolder-post-messagerules?view=graph-rest-1.0&tabs=http and the Exchange Server will do all the work when it comes to doing the Auto-response (and has loop detection logic already) and your logic app then just need to do the Creation and management of the Rules.
But I would suggest you clarify with the person who assigned you the task whether they want the logic app to do the response (eg using the Graph API) or if its okay for the Exchange Server to do this for then (which should be more reliable).
You can also create Rules via the Exchange Admin Center and you could probably also through in Power Automate into the mix to do Autoresponse's so I'd clarify what they want so you don't waste time building something they don't want.

Changing MS Exchange Settings through API (rather than dashboard)

I am new to Microsoft Exchange Server(2016). I am trying to fetch or change Exchange server mail spam filter settings using API call through the code. However, I have not come across any documentation that helps me with this. What would be the best way to do this? If someone can share documentation with me, it will be great.
If you want to change server setting then you will need to use the Exchange Management Shell cmdlets which you can call from Managed code using something like https://learn.microsoft.com/en-us/previous-versions/office/developer/exchange-server-2010/ff326159(v%3Dexchg.140)
The specific cmdlets and examples for the AntiSpam settings can be found in https://learn.microsoft.com/en-us/exchange/antispam-and-antimalware/antispam-protection/configure-antispam-settings?view=exchserver-2019

Best development technologies to use to connect to exchange server, discover DAGs, creating mailbox data bases etc... (preferably in C#. .net)

I am new to Development with Exchange server. I am trying to do things like conencting to exchange server, discovering and creating Database Availablity Groups (DAG), discovering and creating mail box databses within a DAG etc... programmatically.
I see there are few PowerShell cmdlets to do the above things. I am wondering what is the best development technology to use for above things? Can i use EWS Manamgement API?
the technology should be compatible with Exchange Server 2010 and 2013 and preferably .net (C# - please note that i am trying to manage remote exchange servers)
regards,
Dreamer
The only option to manage exchange server is wrapping exchange management shell cmdlets in c# and invoking them.
Please see http://social.msdn.microsoft.com/Forums/en-US/exchangesvrdevelopment/thread/155504b3-ffe3-4bdf-887a-1e61842a8697 for more details.
thank you,
Dreamer

Sending Tasks using an offline Outlook

I've a scenario wherein I need to send/assign tasks from my browser UI to the concerned. This should happen with Outlook being offline (or for that matter outlook not even configured on the terminal) so that the user can be accessing a workflow from any terminal (using his/her AD credentials) and if required should have the ability to send a task to the concerned without having to return to his own terminal to be able to do so.
I envision that the user's credentials should be used to look up the AD for his/her email ID and send a task using the same from anywhere in the intranet.
Using Outlook object library I have been able to assign/send tasks, but with the Outlook being fired up and not otherwise.
Redemption does the sync of contacts while Outlook is offline but not tasks.
Kindly help if anybody has had a chance to do something similar.
Thanks in advance.
Redemption could help you here as you can run it it on a web server which will connect to you exchange env via mapi for you.
There are other ways dependant on you version of exchange EWS or Exchange DAV.
EWS comes with a managed API now a days to take some of the sting out of it.
There are similar 3rd party libraries for Exchange DAV as well.
They all contain contact and directory lookups.

MS Exchange Server 2003: any good scripting tutorial?

I need to write a script for MS Exchange Server 2003 that will analyze incoming emails and put some of them into a specific mailbox. Of course it's a lot of information about Exchange Server scripting at MSDN, but amount of information there is very huge. Is it some simple tutorials available that will describe how to install a simple script on MS Exchange Server that will analyze incoming emails?
I believe the only way to accomplish what you want in exchange 2003 is to write an smtp event sink. Here is an overview. http://www.codeproject.com/KB/cs/csmanagedeventsinkshooks.aspx
Unfortunately, event sinks can be prone to have very poor performance characteristics and are generally discouraged. However, I believe that is the way to accomplish what you want to do.
If you decide to go down this path, here are a couple of references for you:
http://support.microsoft.com/kb/894286 and
http://msdn.microsoft.com/en-us/library/ms998610.aspx
Try these? (the first one is for exchange 07)
http://www.codeproject.com/KB/exchange/Exchange2007EWS-Part1.aspx
http://www.codeproject.com/KB/cs/Exchange_2003_with_WebDav.aspx

Resources