Quantcast
Channel: Exchange Server Development forum
Viewing all 7132 articles
Browse latest View live

Reuse EWS connection and negotiate authentication for Exchange

$
0
0

I am writing a program to dump the contents of numerous mailboxes from an Exchange server using EWS in C#. Using fiddler I noticed that each request I send makes a new connection (tunnel), with a new authentication process being undertaken (using negotiate). My ServerCertificateValidationCallback gets called for every request.

If I enable the option in Fiddler to "reuse server connections" than the connection is only created during handshaking, and is re-used for all requests (saving lots of time).

By getting the EWS source and modifying the requests I found if I enable "UnsafeAuthenticatedConnectionSharing" on the request objects than the connection is re-used (extra tunnels & ServerCertificateValidationCallbacks disappear), but each request still requires the full handshake authentication. This is because the server sends back a 401 when ever I try and use the exchange cookie.

Is there any way I can re-use my server connection & authentication?

public class EwsExchange
{
    static int Main(string[] args)
    {
        sslCertCheckCount = 0;
        ServicePointManager.ServerCertificateValidationCallback = ServerCertificateValidation;

        ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2010_SP1);
        service.Credentials = new NetworkCredential(args[1], args[2]);
        service.Url = new Uri(args[0] + @"/EWS/exchange.asmx");
        service.KeepAlive = true;
        service.PreAuthenticate = true;
        //service.UnsafeAuthenticatedConnectionSharing = true;

        Folder folder = Folder.Bind(service, WellKnownFolderName.Inbox, new PropertySet(FolderSchema.Id, FolderSchema.DisplayName));
        FindItemsResults<Item> res = folder.FindItems(new ItemView(int.MaxValue));

        return 0;
    }

    public static bool ServerCertificateValidation(Object obj, X509Certificate certificate, X509Chain chain, System.Net.Security.SslPolicyErrors errors)
    {
        Console.WriteLine(String.Format(" ****************** ServerCertificateValidation - count: {0}. ****************** ", ++sslCertCheckCount));
        return true;
    }

    static int sslCertCheckCount;
}

Thanks!


Monitoring Meetings for all mailboxes in an Exchange Server

$
0
0

Using C# and .Net (4.0 + ), is there a way to monitor meeting items across all mailboxes in Exchange without having to access each mailbox individually? 

I have to write an integration service that can do this (on Exchange 2010 SP3) and then add all external attendees to a Visitor Management System.

The EWS Managed API and Exchange Management Shell seem to only provide access to a single mailbox's calendar at a time. I've come up with 2 work-around ideas, but neither seem very elegant.
1. Create a Service account that acts as a delegate for all other accounts (This probably has a massive overhead on the System Admin's time, unless it can be done programmatically)

2. Create a Service/resource account that can be added to meetings as a resource. Then create a Outlook plugin that can force the resource on each new meeting created if external addresses are detected. Then hope that the System admins have a way to roll out the Outlook plugin. (Massive overhead on staff, again, but the more elegant of the 2 solutions).

Any help/Ideas will be greatly appreciated. 


[EWS][500][Exchange2007] Export Item Return exception " The remote server returned an error: (500) Internal Server Error."

$
0
0

Hi

I export a mail from exchange 2007(version 8.3) by EWSEditor1.10.0.34502, but it pop a exception :

Exception details:
Message: The remote server returned an error: (500) Internal Server Error.
Type: System.Net.WebException
Source: System
Stack Trace:
   at System.Net.HttpWebRequest.GetResponse()
   at EWSEditor.Exchange.ExportUploadHelper.ExportItemPost(String ServerVersion, String sItemId, String sFile) in c:\Users\administrator.EX07HBBU\Desktop\EWSEditor 1.10 - code\EWSEditor\Exchange\ExportUploadHelper.cs:line 125
   at EWSEditor.Forms.ItemsContentForm.MnuExportToStream_Click(Object sender, EventArgs e) in c:\Users\administrator.EX07HBBU\Desktop\EWSEditor 1.10 - code\EWSEditor\Forms\ItemsContentForm.cs:line 595
   at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
   at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
   at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
   at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
   at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
   at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at System.Windows.Forms.ToolStrip.WndProc(Message& m)
   at System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

And the export item request xml is:

<?xml version="1.0" encoding="utf-8" ?><soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
      xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types"
      xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages"><soap:Header><t:RequestServerVersion Version="Exchange2007_SP1"/></soap:Header><soap:Body><m:ExportItems><m:ItemIds><t:ItemId Id="AAMkAGM5ZDcwMTFmLTU5MDItNGMyMS1iNWUyLTFlOGZmODAzYTgxNQBGAAAAAACBrpeJCEvYTqyaT++BC2OKBwDBnJr2Owd/Q4lHnMbiUhr8AG7iBnqAAADBnJr2Owd/Q4lHnMbiUhr8AIFctnGjAAA="/></m:ItemIds></m:ExportItems></soap:Body></soap:Envelope>

I check the IIS log files, and there are some information(please see the last red line):

#Software: Microsoft Internet Information Services 7.5
#Version: 1.0
#Date: 2015-05-12 21:53:00
#Fields: date time s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs(User-Agent) sc-status sc-substatus sc-win32-status time-taken
2015-05-12 21:53:00 155.35.123.133 POST /EWS/Exchange.asmx - 443 - 155.35.79.197 EWSEditor+(ExchangeServicesClient/15.00.0913.015) 401 2 5 109
2015-05-12 21:53:02 155.35.123.133 POST /EWS/Exchange.asmx SoapAction=GetItem;Version=1;RpcC=9;RpcL=62;LdapC=7;LdapL=16; 443 EX07HBBU\test02 155.35.79.197 EWSEditor+(ExchangeServicesClient/15.00.0913.015) 200 0 0 156
2015-05-12 21:53:21 155.35.123.133 POST /EWS/Exchange.asmx - 443 - 155.35.79.197 - 401 2 5 93
2015-05-12 21:53:21 155.35.123.133 POST /EWS/Exchange.asmx - 443 EX07HBBU\test02 155.35.79.197 - 500 0 0 156
2015-05-12 21:59:54 155.35.123.133 POST /Autodiscover/Autodiscover.xml - 443 - 155.35.79.197 EWSEditor+(ExchangeServicesClient/15.00.0913.015) 401 2 5 78
2015-05-12 21:59:55 155.35.123.133 POST /Autodiscover/Autodiscover.xml - 443 EX07HBBU\test02 155.35.79.197 EWSEditor+(ExchangeServicesClient/15.00.0913.015) 200 0 0 187
2015-05-12 21:59:55 155.35.123.133 POST /EWS/Exchange.asmx - 443 - 155.35.79.197 EWSEditor+(ExchangeServicesClient/15.00.0913.015) 401 2 5 202
2015-05-12 21:59:55 155.35.123.133 POST /EWS/Exchange.asmx SoapAction=ConvertId;Version=1;LdapC=3;LdapL=16; 443 EX07HBBU\test02 155.35.79.197 EWSEditor+(ExchangeServicesClient/15.00.0913.015) 200 0 0 171
2015-05-12 21:59:58 155.35.123.133 POST /EWS/Exchange.asmx - 443 - 155.35.79.197 EWSEditor+(ExchangeServicesClient/15.00.0913.015) 401 2 5 93
2015-05-12 21:59:58 155.35.123.133 POST /EWS/Exchange.asmx SoapAction=GetFolder;Version=1;RpcC=7;RpcL=15;LdapC=1;LdapL=0; 443 EX07HBBU\test02 155.35.79.197 EWSEditor+(ExchangeServicesClient/15.00.0913.015) 200 0 0 218
2015-05-12 22:00:00 155.35.123.133 POST /EWS/Exchange.asmx - 443 - 155.35.79.197 EWSEditor+(ExchangeServicesClient/15.00.0913.015) 401 2 5 202
2015-05-12 22:00:00 155.35.123.133 POST /EWS/Exchange.asmx SoapAction=GetFolder;Version=1;RpcC=6;RpcL=0;LdapC=0;LdapL=0; 443 EX07HBBU\test02 155.35.79.197 EWSEditor+(ExchangeServicesClient/15.00.0913.015) 200 0 0 156
2015-05-12 22:00:01 155.35.123.133 POST /EWS/Exchange.asmx - 443 - 155.35.79.197 EWSEditor+(ExchangeServicesClient/15.00.0913.015) 401 2 5 202
2015-05-12 22:00:01 155.35.123.133 POST /EWS/Exchange.asmx SoapAction=FindFolder;Version=1;RpcC=6;RpcL=0;LdapC=0;LdapL=0; 443 EX07HBBU\test02 155.35.79.197 EWSEditor+(ExchangeServicesClient/15.00.0913.015) 200 0 0 171
2015-05-12 22:00:03 155.35.123.133 POST /EWS/Exchange.asmx - 443 - 155.35.79.197 EWSEditor+(ExchangeServicesClient/15.00.0913.015) 401 2 5 15
2015-05-12 22:00:03 155.35.123.133 POST /EWS/Exchange.asmx SoapAction=GetFolder;Version=1;RpcC=6;RpcL=0;LdapC=0;LdapL=0; 443 EX07HBBU\test02 155.35.79.197 EWSEditor+(ExchangeServicesClient/15.00.0913.015) 200 0 0 93
2015-05-12 22:00:03 155.35.123.133 POST /EWS/Exchange.asmx - 443 - 155.35.79.197 EWSEditor+(ExchangeServicesClient/15.00.0913.015) 401 2 5 202
2015-05-12 22:00:04 155.35.123.133 POST /EWS/Exchange.asmx SoapAction=FindFolder;Version=1;RpcC=6;RpcL=0;LdapC=0;LdapL=0; 443 EX07HBBU\test02 155.35.79.197 EWSEditor+(ExchangeServicesClient/15.00.0913.015) 200 0 0 15
2015-05-12 22:00:07 155.35.123.133 POST /EWS/Exchange.asmx - 443 - 155.35.79.197 EWSEditor+(ExchangeServicesClient/15.00.0913.015) 401 2 5 171
2015-05-12 22:00:07 155.35.123.133 POST /EWS/Exchange.asmx SoapAction=GetFolder;Version=1;RpcC=6;RpcL=0;LdapC=0;LdapL=0; 443 EX07HBBU\test02 155.35.79.197 EWSEditor+(ExchangeServicesClient/15.00.0913.015) 200 0 0 202
2015-05-12 22:00:07 155.35.123.133 POST /EWS/Exchange.asmx - 443 - 155.35.79.197 EWSEditor+(ExchangeServicesClient/15.00.0913.015) 401 2 5 202
2015-05-12 22:00:08 155.35.123.133 POST /EWS/Exchange.asmx SoapAction=FindItem;Version=1;RpcC=6;RpcL=0;LdapC=0;LdapL=0; 443 EX07HBBU\test02 155.35.79.197 EWSEditor+(ExchangeServicesClient/15.00.0913.015) 200 0 0 93
2015-05-12 22:00:14 155.35.123.133 POST /EWS/Exchange.asmx - 443 - 155.35.79.197 EWSEditor+(ExchangeServicesClient/15.00.0913.015) 401 2 5 109
2015-05-12 22:00:14 155.35.123.133 POST /EWS/Exchange.asmx SoapAction=GetItem;Version=1;RpcC=6;RpcL=0;LdapC=5;LdapL=16; 443 EX07HBBU\test02 155.35.79.197 EWSEditor+(ExchangeServicesClient/15.00.0913.015) 200 0 0 156
2015-05-12 22:00:17 155.35.123.133 POST /EWS/Exchange.asmx - 443 - 155.35.79.197 EWSEditor+(ExchangeServicesClient/15.00.0913.015) 401 2 5 46
2015-05-12 22:00:17 155.35.123.133 POST /EWS/Exchange.asmx SoapAction=GetItem;Version=1;RpcC=6;RpcL=15;LdapC=5;LdapL=0; 443 EX07HBBU\test02 155.35.79.197 EWSEditor+(ExchangeServicesClient/15.00.0913.015) 200 0 0 327
2015-05-12 22:00:40 155.35.123.133 POST /EWS/Exchange.asmx - 443 - 155.35.79.197 EWSEditor+(ExchangeServicesClient/15.00.0913.015) 401 2 5 202
2015-05-12 22:00:40 155.35.123.133 POST /EWS/Exchange.asmx SoapAction=CopyItem;Version=1;RpcC=11;RpcL=15;LdapC=0;LdapL=0; 443 EX07HBBU\test02 155.35.79.197 EWSEditor+(ExchangeServicesClient/15.00.0913.015) 200 0 0 156
2015-05-12 22:00:40 155.35.123.133 POST /EWS/Exchange.asmx - 443 - 155.35.79.197 EWSEditor+(ExchangeServicesClient/15.00.0913.015) 401 2 5 15
2015-05-12 22:00:40 155.35.123.133 POST /EWS/Exchange.asmx SoapAction=FindItem;Version=1;RpcC=6;RpcL=0;LdapC=0;LdapL=0; 443 EX07HBBU\test02 155.35.79.197 EWSEditor+(ExchangeServicesClient/15.00.0913.015) 200 0 0 202
2015-05-12 22:00:46 155.35.123.133 POST /EWS/Exchange.asmx - 443 - 155.35.79.197 EWSEditor+(ExchangeServicesClient/15.00.0913.015) 401 2 5 202
2015-05-12 22:00:46 155.35.123.133 POST /EWS/Exchange.asmx SoapAction=GetItem;Version=1;RpcC=6;RpcL=0;LdapC=5;LdapL=15; 443 EX07HBBU\test02 155.35.79.197 EWSEditor+(ExchangeServicesClient/15.00.0913.015) 200 0 0 405
2015-05-12 22:00:57 155.35.123.133 POST /EWS/Exchange.asmx - 443 - 155.35.79.197 EWSEditor+(ExchangeServicesClient/15.00.0913.015) 401 2 5 46
2015-05-12 22:00:57 155.35.123.133 POST /EWS/Exchange.asmx SoapAction=GetFolder;Version=1;RpcC=6;RpcL=0;LdapC=0;LdapL=0; 443 EX07HBBU\test02 155.35.79.197 EWSEditor+(ExchangeServicesClient/15.00.0913.015) 200 0 0 202
2015-05-12 22:00:57 155.35.123.133 POST /EWS/Exchange.asmx - 443 - 155.35.79.197 EWSEditor+(ExchangeServicesClient/15.00.0913.015) 401 2 5 78
2015-05-12 22:00:58 155.35.123.133 POST /EWS/Exchange.asmx SoapAction=FindItem;Version=1;RpcC=6;RpcL=46;LdapC=0;LdapL=0; 443 EX07HBBU\test02 155.35.79.197 EWSEditor+(ExchangeServicesClient/15.00.0913.015) 200 0 0 124
2015-05-12 22:01:01 155.35.123.133 POST /EWS/Exchange.asmx - 443 - 155.35.79.197 EWSEditor+(ExchangeServicesClient/15.00.0913.015) 401 2 5 156
2015-05-12 22:01:01 155.35.123.133 POST /EWS/Exchange.asmx SoapAction=GetItem;Version=1;RpcC=6;RpcL=0;LdapC=5;LdapL=16; 443 EX07HBBU\test02 155.35.79.197 EWSEditor+(ExchangeServicesClient/15.00.0913.015) 200 0 0 140
2015-05-12 22:01:13 155.35.123.133 POST /EWS/Exchange.asmx - 443 - 155.35.79.197 EWSEditor+(ExchangeServicesClient/15.00.0913.015) 401 2 5 171
2015-05-12 22:01:13 155.35.123.133 POST /EWS/Exchange.asmx SoapAction=GetItem;Version=1;RpcC=6;RpcL=0;LdapC=5;LdapL=15; 443 EX07HBBU\test02 155.35.79.197 EWSEditor+(ExchangeServicesClient/15.00.0913.015) 200 0 0 202
2015-05-12 22:02:59 155.35.123.133 POST /EWS/Exchange.asmx - 443 - 155.35.79.197 - 401 2 5 93
2015-05-12 22:02:59 155.35.123.133 POST /EWS/Exchange.asmx - 443 EX07HBBU\test02 155.35.79.197 - 500 0 0 62

Did anyone else meet this problem before? How can I find some useful information (such as log, debug) to resolve the problem?

Is caused by Unauthorized from the 401 error(from thepenultimate log)?

Thanks,

Haiyang.




What are the minimum permissions required for a service to be able to create/manage/delete exchange mailbox

$
0
0

I want to know the minimum permissions required to be granted to a service account to be able to create/manage/delete exchange mailbox.

I tried with Recipient Management role but I am getting the following error while creating mailbox

"Error While executing command - Enable-mailbox : No provisioning handler is installed."

Is is possible to use the EWS to loop through emails and send?

$
0
0

Hello,

I have not able able to get this to work. I can't imagine its impossible because it makes no sense to have an API that only sends one email at time or hand code the emails. Is it possible to use a database to gather a group of emails and loop through them and add them then send the email?

Something like this?

 foreach (var item in vendorEmails)
            {
              
                email.ToRecipients.Add(item.email);
                
            }

Nothing I've tried seems to work. Even if I only make the select statement 10 emails it still just sits there and never completes. Has anyone ever done this?I am assuming there is a way.

Thanks

Laura

Integrated windows authentication via EWS on Office 365.

$
0
0

Anyone know if there's a way to get my custom .net app to auto authenticate to office 365 mailboxes like it does with on premises exchange mailboxes? I use the current windows credentials in my app to authentication to the local exchange fine. However, in Office 365 I have to explicitly specify the users email and password. Is there a setting on offfice 365 that would allow this. I think it's also called Anonymous authentication...  

I tried with the EWSEditor test tool also and it's default windows credentials feature fails for office 365 also.

https://ewseditor.codeplex.com/

Any suggestions would be great!

Streaming Notification event is not raising for Sent Items folder

$
0
0

Hi All,

I am implementing a streaming notification technique in Email client application. For Inbox folder any new email arrives it is raising the event. But for Sent Items folder notification event not firing.

Below is the code snippet.

For Inbox:

StreamingSubscription streamingSubscription = service.SubscribeToStreamingNotifications(new FolderId[] { WellKnownFolderName.Inbox },EventType.NewMail);

connection.AddSubscription(streamingSubscription);
        connection.OnNotificationEvent += connection_OnNotificationEvent;
        connection.OnDisconnect += connection_OnDisconnect;
        connection.Open();

void connection_OnNotificationEvent(object sender, NotificationEventArgs args)
{

var newMails = from e in args.Events.OfType<ItemEvent>()
                               where e.EventType == EventType.NewMail || e.EventType== EventType.Created
                               select e.ItemId;

}

For Sent Items:

treamingSubscription streamingSubscription = service.SubscribeToStreamingNotifications(new FolderId[] { WellKnownFolderName.SentItems},EventType.Created);

connection.AddSubscription(streamingSubscription);
        connection.OnNotificationEvent += connection_OnNotificationEvent;
        connection.OnDisconnect += connection_OnDisconnect;
        connection.Open();

void connection_OnNotificationEvent(object sender, NotificationEventArgs args)
{

var newMails = from e in args.Events.OfType<ItemEvent>()
                               where e.EventType == EventType.NewMail || e.EventType== EventType.Created
                               select e.ItemId;

}

Thanks

Naresh


Using SearchFilter set to ConstainsSubstring causes exception

$
0
0

I am developing an Outlook add-in that communicates with EWS (in this case Office 365) and am trying to delete appointments by category. Each appointment has two categories. I am using SearchFilter to get a FindItemResults collection which I then use to delete appointments.

When the SearchFilter is set to IsEqualTo everything works but items are only found if the category named in the search filer comes first of the two. Setting the SearchFilter to ContainsSubstring ought to fix this but EWS returns an exception on the last line of the code block below.

searchFilterCollection.Add(new SearchFilter.IsEqualTo(ItemSchema.Categories, category.Trim()));
searchFilter = new SearchFilter.SearchFilterCollection(LogicalOperator.And, searchFilterCollection.ToArray());

//Find items to delete
ItemView view = new ItemView(500);
view.PropertySet = new PropertySet(BasePropertySet.IdOnly, AppointmentSchema.Subject, AppointmentSchema.Start);
findResults = exchangeService.FindItems(WellKnownFolderName.Calendar, searchFilter, view);

The error details are:

Error at InternalThrowIfNecessary : Microsoft.Exchange.WebServices.Data.ServiceResponseException An internal server error occurred. The operation failed. <o:p></o:p>

Message: An internal server error occurred. The operation failed.
Site: InternalThrowIfNecessary
Stack Trace:    at Microsoft.Exchange.WebServices.Data.ServiceResponse.InternalThrowIfNecessary()
   at Microsoft.Exchange.WebServices.Data.ServiceResponse.ThrowIfNecessary()
   at Microsoft.Exchange.WebServices.Data.MultiResponseServiceRequest`1.Execute()
   at Microsoft.Exchange.WebServices.Data.ExchangeService.FindItems[TItem](IEnumerable`1 parentFolderIds, SearchFilter searchFilter, String queryString, ViewBase view, Grouping groupBy, ServiceErrorHandling errorHandlingMode)<o:p></o:p>

   at Microsoft.Exchange.WebServices.Data.ExchangeService.FindItems(FolderId parentFolderId, SearchFilter searchFilter, ItemView view)<o:p></o:p>

   at Microsoft.Exchange.WebServices.Data.ExchangeService.FindItems(WellKnownFolderName parentFolderName, SearchFilter searchFilter, ItemView view)<o:p></o:p>

   at GreenhillSoftware.ACalWinFormLib.Logic.ExchangeServiceManager.DeleteAppointmentsInExchange(String category, DateTime start, DateTime end, Form frm, String staffCode) in c:\VS Projects\Outlook Add-ins\ACal4\ACalWinFormLib\Logic\clsExchangeServiceManager.cs:line 864<o:p></o:p>


Mike VE


No. of instances for “Forefront Exchange Realtime Scanner” in Perfmon

$
0
0

Hi,

We have installed “ForeFrontProtection2010 forExchange “in our environment for Exchange server 2010 SP2.

We are monitoring data for Realtime scanning through perfmon object “Forefront Exchange Realtime Scanner”.

We have observed that the no. of instances for “Forefront Exchange Realtime Scanner” in Perfmon corresponds to process count set in “Policy Management->Antimalware->Mailbox Realtime->Additional Options->Process Count”. So, if we set the process count to maximum value 10, no. of instances seen in perfmon application is 13 i.e. 10(processes) + 3 (Default instances: _CumulativeTotal, _RunningTotal, _total)

As per https://technet.microsoft.com/en-in/library/cc483036.aspx, the default value for Process Count is 4; the maximum value is 10.So, we can haveat max 13 instances of Forefront Exchange Realtime Scanner in Perfmon.

Is the above observation correct or is it possible to have more than 13 valid instances for “Forefront Exchange Realtime Scanner”?

In one of the environment, we could see lot of instances for “Forefront Exchange Realtime Scanner” but, only 13 appeared to be valid.For rest, it more looked like the corrupt data.To fix the corrupt object,we tried reloading the perfmon counter but, it still shows up the same way.Any information on this is welcomed.

Thanks in advance.


Sandeep Gupta

EWS UpdateItems method and older versions of Exchange

$
0
0

Does UpdateItems (batch update of items) method of EWS Managed Api work with Exchange Serve 2010 and/or 2007?

Msdn  documentation is not precise about this issue. 

Thank you all


Drasko Popovic

EWS API -- "The move or copy operation failed" for a specific email

$
0
0

Hi,

I'm working on a console application that is using EWS Managed API to connect to a mailbox and process emails.  After processing has completed for an email, the program calls the API's move() on the EmailMessage to move it to another folder.

During our testing, the move has been working just fine but we recently encountered one specific email that does not move.  We think that it is something intrinsic about the email itself that will not allow it to be moved on the exchange server.  We get the following exception message (relevant parts of stack-trace included):

"The move or copy operation failed"

StackTrace:

at Microsoft.Exchange.WebServices.Data.ServiceResponse.InternalThrowIfNecessary()

   at Microsoft.Exchange.WebServices.Data.MultiResponseServiceRequest`1.Execute()

   at Microsoft.Exchange.WebServices.Data.ExchangeService.MoveItem(ItemId itemId, FolderId destinationFolderId)

   at Microsoft.Exchange.WebServices.Data.Item.Move(FolderId destinationFolderId)

All other emails are moving just fine.  Nothing seems strange about the email.  It just has one .png image attachment.  I can open that attachment fine.  We are processing an outlook 365 mailbox, and I tried moving the email to my local outlook mailbox and processing it there and that works.  So it must be something on the exchange server that doesn't like this particular email.   We thought something could be locking it on the server temporarily, but when we tried again on the server, the move failed again with the same exception.  What do you think?  The code that does the move is included below, in case you can see any issue there.  Thanks!

Here's the function I have to move an email item to a specified folder (a subfolder under Inbox)  

Private Sub MoveToFolder(email As Item, folderName As String)

            ' Moves an email to the specified folder

            Dim folderView As New FolderView(100)
            folderView.PropertySet = New PropertySet(BasePropertySet.IdOnly)
            folderView.PropertySet.Add(FolderSchema.DisplayName)
            folderView.Traversal = FolderTraversal.Deep
            Dim findFolderResults As FindFoldersResults = email.Service.FindFolders(WellKnownFolderName.Inbox, folderView)

            Dim destFolder As Folder = findFolderResults.Where(Function(f As Folder) f.DisplayName = folderName) _
                                                        .FirstOrDefault()
            If destFolder Is Nothing Then

                ' If the folder doesn't exist, create it

                destFolder = New Folder(email.Service)
                With destFolder
                    .DisplayName = folderName
                    .Save(parentFolderName:=WellKnownFolderName.Inbox)
                End With
            End If

            Dim emailMessage As EmailMessage = DirectCast(email, EmailMessage)
            emailMessage.Move(destFolder.Id)

        End Sub

Thank you!

Transport agent on two CAS+MB servers

$
0
0

Good day.
I am developing simple transport agent that extracts and saves attachments in messages by criteria and then deletes attachments from message.

Agent is working fine but I've run into a problem with deployment.

Our organization have two Exchange 2013 (CU7) servers and each of them hosts both roles (CAS+MB).
If I deploy TA on each server it conflicts - some attaches is cut on first server, some on second server. As a result some files remains unextracted.

How I need to deploy TA to process EVERY message that flows through E2013 organization but avoid double processing?

Thank you.

Enable-Mailbox after Disable-Mailbox

$
0
0

Hi everybody,

I disabled a mailbox by giving "Disable-Mailbox" command and then enabled it using "Enable-Mailbox" command. Prior to giving "Enable-Mailbox" command, that mailbox had emails. After running "Enable-Mailbox", it is empty. Can you suggest any way to have the emails back into the mailbox?

Thanks & regards,

Amit Jha



ServiceXmlDeserializationException on Lookup

$
0
0

Hi,

My Exchange server is hosted on premises.

I've created a program using EWS Managed API, which does following,

- Automatic discovery, Calendar, Email, Meeting...

It works well, as long as I'm running it from laptop who is part of same domain. And, it works even if I make direct internet connectivity from my laptop.

Issue,

I've deployed my application on Cloud (Windows Azure).

When I run same application, it gives me ServiceXmlDeserializationException on automatic discovery.

What could be the issue?

Vinay


vin14976@hotmail.com TechCenter Forums

Autodiscover works, but getting a 403 (forbidden) error

$
0
0

I am testing my app (currently with the java api) against a user on a corporate account.

On office365 , everything worked fine.

The funny thing. The autodiscovery was successful, but when I tried to issue an EWS call, I got an exception with a 403 error.

With the combination of:

email address:  roger@acme.com

password: 123

url: https://lonneymail.acme.com/EWS/Exchange.asmx

domain : northamerica


How should I: 

1) construct the webcredentials (either .net or java apis)

2) if I am using straight soap/https requests, do I need to include the domain in the mix? how exactly ?

I tried to look at the usual examples with "contoso" but there is a great deal of intermixing between user/email/domain/server, etc.... so in the above acme example, it is clear where each part belongs. 

thanks,

  Erez 



CollectOverMetrics.ps1 Help

$
0
0

Exchange 2013 SP1 with 2 member DAG. Trying to use collectovermetrics. When running .\collectovermetrics -generatehtmlreport I get:

PS C:\Program Files\Microsoft\Exchange Server\V15\Scripts> .\collectovermetrics.ps1 -GenerateHtmlReport
cmdlet CollectOverMetrics.ps1 at command pipeline position 1
Supply values for the following parameters:
DatabaseAvailabilityGroup: DAG1
Get statistics from server0
Get statistics from server1
Found total of 0 entries

Generated the following per-DAG reports:
C:\Program Files\Microsoft\Exchange Server\V15\Scripts\FailoverReport.DAG1.2015_05_16_22_05_39.csv

Importing data from C:\Program Files\Microsoft\Exchange Server\V15\Scripts\FailoverReport.DAG1.2015_05_16_22_05_39.csv

Generating summary report
WriteHtmlReport : Cannot bind argument to parameter 'Data' because it is null.
At C:\Program Files\Microsoft\Exchange Server\V15\Scripts\CollectOverMetrics.ps1:1463 char:31
+         WriteHtmlReport -Data $AmOperationsData -ReportPath $HtmlSummaryReportNa ...+                               ~~~~~~~~~~~~~~~~~+ CategoryInfo          : InvalidData: (:) [WriteHtmlReport], ParameterBindingValidationException+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,WriteHtmlReport

Summary report is C:\Program Files\Microsoft\Exchange Server\V15\Scripts\FailoverSummary.2015_05_16_22_05_39.htm

So you can see the report is 0 and size is 0kb. As far as I know this script is unmodified. Why are the entries in the DAG 0 which I suppose is why the report is 0kb in size?

A program in C++ that can connect to Exchange email servers in cloud and fetch/send messages

$
0
0

Hi Dear,

The title of this post is my Aim. So I need help for How to getting started and create it using C++. 

After Search it on Google I have found some following way which is given below..

1). I found gSOAP library. http://www.cs.fsu.edu/~engelen/soap.html

2). Office 365 REST API (Outlook mail API)  https://msdn.microsoft.com/office/office365/APi/mail-rest-operations

3) WWSAPI with EWS

I need to do this in cloud with C++. So please tell me which is easy way to do this and if this is not then please tell me any other alternative way, if you have... But for me it is necessary to implement this in C++.

Thanks!!


Decommissioning Exchange 2003 After Staged Migration to Exchange Online

$
0
0

We have just completed a staged migration from a single Exchange 2003 Server to Exchange Online (Office 365) using the guide, "Perform a Staged Migration of email to Office 365."

At the end of the guide, Microsoft warns: Decommissioning Exchange can have unintended consequences. Before decommissioning your on-premises Exchange organization, we recommend that you contact Microsoft Support.

The following have been accomplished so far:

  • All on-prem mailboxes have migrated successfully.
  • All on-prem users have been converted to mail-enabled users.
  • Their mailboxes no longer exist in Exchange 2003, as part of the conversion to MEUs.
  • DirSync is used to synch AD up to Office 365.

We plan to:

  • Decommission Exchange Server 2003.
  • Upgrade domain controllers from Windows Server 2003 SP2 to 2012 R2.

Since Exchange 2003 doesn't work in 2012 DFL/FFL, it most likely isn't possible to use any 2003 management tools to edit ADUC.

In this scenario, would you recommend to simply uninstall Exchange 2003?

Thanks!





Creating and filling a shared mailbox

$
0
0

Not sure if I should ask this question here or in the outlook forum.

I have the following scenario,

I have SharePoint lists that contain mails these mails are dropped there by several people.

Unfortunatly these mails can't be searched effectively/user friendly in SharePoint (SharePoint lists don't hold the mail meta data)

So I figured the following , create shared mailboxes, let user fill those and fill the SharePoint lists from these mailboxes.

My plan:

Make an outlook add-in that can create shared mailboxes in exchange and set permissions automatically (permissions are always the same).

My questions:

Is it possible to make an exchange shared folder and set permissions via code (c#.net or vb.net)

Is it possible to make exchange via code write all new mails from a shared mailbox to a SharePoint list (I know the SharePoint side what I'm interested in is:  if it is possible in exchange to detect new mails in a shred mailbox and do some action on that

any other usefull insight is welcomed aswell :-)


C++ with gsoap to read email from outlook using exchange web services

$
0
0

Hi,

how can we use C++ with gSOAP to fetch email data from outlook mail (in office 365) using exchange web services. Is there need to be authentication API of office 365, and if yes, then does this API support C++ language.

OR gSOAP is enough to read the data of email from exchange server of office 365. and in gSOAP is there need to be authentication, If yes then which one? please help me.

My AIM: A program in C++ that can connect to Exchange email servers in cloud and fetch/send messages.

So if you have any other alternative good and easy way to do this with C++, Please tell me.

Thanks!!

Viewing all 7132 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>