Changing MS Exchange Settings through API (rather than dashboard) - outlook

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

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.

Reading Exchange 2003 WebDAV custom properties with EWS after upgrading to Exchange 2010

I have an old Exchange 2003 server that we connected to via WebDAV. We had one app using it and in it we were setting some custom properties to appointments in the DAV namespace like DAV:OrderId, where OrderId is the name of the custom property.
Now we're going to move the mailbox to Exchange 2010 to start with and since there's no WebDAV support for it, I can't find a way how to read that custom property with Managed EWS (Exchange Web Services).
I tried getting them with searching through
DefaultExtendedPropertySet.Common
and
DefaultExtendedPropertySet.PublicStrings
collections, but of course they're not there.
Our app kind of needs those properties to work.
Anyone have any ideas?
Sorry I can't be more specific here, but I've not wanted to grab any custom properties off Exchange items. However, there is a way to get MAPI props in EWS, and there may be a way to dig out the custom props as well. It's worth a look. Start here, and let us know if you work it out!
Well I found what I was doing wrong.
By using MFCMapi on the Exchange 2003 server I was able to see that the actual full property name is "DAV:OrderId" and not just "OrderId". It's namespace is DefaultExtendedPropertySet.PublicStrings. So just use those two pieces of information when querying with EWS and you're good to go.

Accessing all email on Exchange Server

I would like to programmatically be able to access all the emails stored in an exchange server in order to do some text analysis on those emails. How would I go about this, assuming I had all the necessary permissions and direct access to the server?
My gut says you should use eDiscovery tools built into Exchange, but I'm not entirely sure that will accomplish what you want. eDiscovery does what it was designed to do pretty well, but that's entirely focused around finding emails in a date range or via keyword.

Exchange ews api, list all users

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.

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

Resources