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

When service running with Group Managed Service Account, EWS will not work?

$
0
0

Hi

I'm using Group Management Service Account to run my service, and this service will call EWS api to get sub folders in user's mailbox.  And I've assigned the impersonate permission to this service account.

But when it runs, an exception has comes out,

Exception caught and ignored: The SMTP address has no mailbox associated with it., StackTrace:    at Microsoft.Exchange.WebServices.Data.ServiceRequestBase.ProcessWebException(WebException webException)
   at Microsoft.Exchange.WebServices.Data.ServiceRequestBase.GetEwsHttpWebResponse(IEwsHttpWebRequest request)
   at Microsoft.Exchange.WebServices.Data.ServiceRequestBase.ValidateAndEmitRequest(IEwsHttpWebRequest& request)
   at Microsoft.Exchange.WebServices.Data.MultiResponseServiceRequest`1.Execute()
   at Microsoft.Exchange.WebServices.Data.ExchangeService.BindToFolder[TFolder](FolderId folderId, PropertySet propertySet)

And in the meantime, in the windows event log, there's an error come out,

(Process w3wp.exe, PID 9092) "RBAC authorization returns Access Denied for user SMEX12\SMEX12Test$ (SID=S-1-5-21-709115522-1612298502-133514736-1673). Reason: User was not found on Domain Controller ex2016ad.smex12.com."

and my group management service account is SMEX12\SMEX12Test$,  and here is the code which have this exceptions below,

rootFolder = Folder.Bind(service, WellKnownFolderName.MsgFolderRoot);

So could you help me? How could I fix this error?  Because I need to use group management service to run service.

Thanks.



Exchange Web Service Managed Api - Save an email as an msg to disk

$
0
0
Hi,
I am trying to save an email that I have retrieved via the EWS managed Api but get the following message when I try and open the file.

"Cannot open file c:\bla\bin... The file may not exist, you may not have permission to open it, or it may be open in another program. Right-click the folder that contails the file, and then click Properties to check your permissions for the folder."

Any help will be much appriciated.

See code below:

public static void save_entire_email_to_disk()
{
    ExchangeService service = GetService();

    var findResults = service.FindItems(WellKnownFolderName.Inbox, new ItemView(10));
    foreach (var result in findResults)
    {
        if (result is EmailMessage)
        {
            var message = result as EmailMessage;
            message.Load(new PropertySet(ItemSchema.MimeContent));
           
            MimeContent mc = message.MimeContent;
            FileStream oFileStream = new FileStream("Test.msg", FileMode.Create);

            oFileStream.Write(mc.Content, 0, mc.Content.Length);
            oFileStream.Close();
        }
    }
}

Cheers,

Zi

Get All Exchange appointments within start and end time

$
0
0

I have to get all appointments of organisation.

Currently, I have only option to loop over the selected items (user,room,equipment) through method FindAppointments.

Is there is any option to get all appointments without calling FindAppointments multiple times ?

Thanks in advance

Vivek Chauhan

How convert HexEntryId to EwsId for message from public folder

$
0
0

I try convert HexEntryId to EwsId

static void Main(string[] args)
        {
            var service = ConnectionToEws.ConnectToService();
            var someFolder = GetFolder(service, "someFolder");

            const string id = "000000001A447390AA6611CD9BC800AA002FC45A09001207274E1F9F314E9787FCD1B7E58F07000137B94C9100001207274E1F9F314E9787FCD1B7E58F07000138C71B740000";

            var alternatePublicFolderItem = new AlternatePublicFolderItemId(IdFormat.HexEntryId, someFolder.Id.UniqueId, id);
            var convertResult = service.ConvertId(alternatePublicFolderItem, IdFormat.EwsId);

            Console.WriteLine(((AlternatePublicFolderItemId)convertResult).ItemId);
            Console.ReadKey();
        }

        private static Folder GetFolder(ExchangeService service, string folderName)
        {
            var folderView = new FolderView(int.MaxValue);
            var findFolderResults = service.FindFolders(WellKnownFolderName.PublicFoldersRoot, folderView);
            foreach (var folder in findFolderResults)
            {
                if (folderName.Equals(folder.DisplayName, StringComparison.InvariantCultureIgnoreCase))
                {
                    return folder;
                }
            }
            return null;
        }

And get next error: Id is malformed. How i can convert this?

Convert back is works (link here)


Regarding office 365 REST APIs

$
0
0

 1. Fetching contacts using GET method , I am getting access denied error.

"error": {
        "code": "ErrorAccessDenied",
        "message": "Access is denied. Check credentials and try again."
    }

url : GET https://outlook.office.com/api/v2.0/me/contacts

2. Is office 365 REST APIs support fetching deleted record of events.

For emails its working : url - GET https://outlook.office.com/api/v2.0/me/MailFolders/deleteditems/messages

How can i do same to fetch contacts as well as calendar events.

Any help is appreciated.Thank you in advance. 

c# Exchange Service CalendarEvent object convert to appointment

$
0
0
Hello,

I am connected the Exchange Server by Exchange Server Managed API. I m getting all rooms and calendar event but calendar event can not give me a detail information. I guess i must convert calendar event object to appointment object. is it possible? How can I do it?
Please help me..
 
foreach (CalendarEvent calendarEvent in attendeeAvailability.CalendarEvents)
            {
                Event newevent = new Event
                {
                    StartDate = calendarEvent.StartTime,
                    EndDate = calendarEvent.EndTime,
                    Subject = calendarEvent.Details == null ? @"N\A" : calendarEvent.Details.Subject,
                    ID = calendarEvent.Details == null ? @"N\A" : calendarEvent.Details.StoreId,
                };
                room.Events.Add(newevent);
            }

How to achieve single sign on using EWS java API

$
0
0

we use spring mvc,

need to fetch user mails from mexchange server and to pass windows credentials or default credentials. 

Managed EWS and TLS 1.2

$
0
0

Hi,

We've been informed that Exchange Online (Office 365) will be phasing out TLS 1.0 and TLS 1.1.

Managed EWS however, seems to be hard coded to use TLS 1.0. I tried setting registry keys to prevent TLS 1.0, and at that point managed EWS refused to connect.

Is there any way to force managed EWS to use TLS 1.2, and if not can we expect a new version which defaults to TLS 1.2 shortly?

Thanks - Lawrence


MAPI and Multiple Exchange Accounts

$
0
0

Hi

I need to know if a exchange postbox in outlook is configured as/in cache mode.
Because since Outlook 2010 it is possible to add more than one exchange account to your mapi profile, it's not suggested to use pbGlobalProfileSectionGuid. Instead evaluate PR_EMSMDB_SECTION_UID.

My problem is however, which profile configuration entry belongs to which postbox?
Is there a property in IProfSect or in IProviderAdmin to detect this safely? Okay, PR_DISPLAY_NAME is same. But is this a good choice?


After OpenProfileSection:

BR
Michael





The double-hop to Exchange (EWS) via web site (IIS 7) without setting browsers negotiate delegation list

$
0
0

Hello,

i have an asp.net mvc 5 application hosted by iis 7 that allows to do basic CRUD operations with user's Exchange calendar items (meetings, appointments). All users are in domain. In IIS: win authorization - on; impersonation - on; useKernelMode - on; AppPool - ApplicationPoolIdentity.

Mostly done as written here https://stackoverflow.com/questions/41424890/ews-managed-api-double-hop

If i set up a browsers NegotiateDelegate white-list on the client machine, my site doesnt ask for login\pass and immediately log in. Everthing is good, default credential pass to Exchange (2016) so i can see (or create, update) my calendar's items on a web page.

If i doesnt set up browers for delegation, site asks domain login\pass, but Exchange returns "The request failed. The remote server returned an error: (401) Unauthorized."

In both cases (if the site asks or not a login), I obtain WindowsIdentity.GetCurrent().Name and other AD properties such as email, ExtensionAttribute.

My question: is it possible to pass default credentials without configuring browsers? Each browser is configured differently and it’s not good to customize them for each user individually. Or maybe I should use a different method than kerberos(NTLM)?

sry 4 my english.

MSExchangeIS Mailbox Counters Messages Deliverd and Local Deliveries

$
0
0

Hi,

I've been collecting performance data on Exchange 2013 for the following MSExchangeIS Mailbox counters:

  • Messages Delivered
  • Local Deliveries

I note both counters are reporting the same values.  I assumed that local deliveries would be less than Messages Delivered.  The counter descriptions don't really help much.

Anyone have any thoughts?

How do I form a EWS XML Request to add an event to a shared calendar

$
0
0

I have been given write access to a shared calendar for a username/pwd that I use to authenticate programmatically to the Exchange server. I want to programmatically add an appointment to this shared calendar using EWS. But I don't see how through the api doc/wsdl. When I use the following I can add an event to the user's personal calendar that I am authenticating to in my code. I want to add the event to a specific shared calendar that this user has write privileges for. All the examples I see are in C#. I don't know C#.

<?xml version="1.0" encoding="utf-8"?><soap:Envelopexmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages"xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types"xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Header><t:RequestServerVersionVersion="Exchange2007_SP1" /><t:TimeZoneContext><t:TimeZoneDefinitionId="Pacific Standard Time" /></t:TimeZoneContext></soap:Header><soap:Body><m:CreateItemSendMeetingInvitations="SendToNone"><m:Items><t:CalendarItem><t:Subject>Tennis lesson</t:Subject><t:BodyBodyType="HTML">Focus on backhand this week.</t:Body><t:ReminderDueBy>2013-09-19T14:37:10.732-07:00</t:ReminderDueBy><t:Start>2013-09-21T19:00:00.000Z</t:Start><t:End>2013-09-21T20:00:00.000Z</t:End><t:Location>Tennis club</t:Location><t:MeetingTimeZoneTimeZoneName="Pacific Standard Time" /></t:CalendarItem></m:Items></m:CreateItem></soap:Body></soap:Envelope>


How to enable anonymous authentication in OWA Exchange 2010

$
0
0

Hello everyone,

I am integrating Access Manager with OWA Exchange 2010.

And I want to know that how to enable anonymous authentication in OWA.

Please, Can you help me.

Thanks

Hale

Decommission Hybrid Exchange 2010 on prem

$
0
0

Hi support team,

We have on prem Hybrid exchange 2010. All mailboxes are in Office 365. We have single sign on using ADFS version 4. 

We would like to get Professional team to help us to decommission our on prem Hybrid exchange server 2010. I understand Microsoft support two Scenario to decommission on prem Hybrid exchange server. 

https://docs.microsoft.com/en-us/exchange/decommission-on-premises-exchange

We would like to follow Scenario two of Microsoft Decommssion on-premises Exchange server. We would like to paid for Microsoft Professional team to help me with Scenario two. I will do most of the work such as create new virtual machine as new Exchange Managment 2016 server on prem for user management.

Can someone get back to me to discuss further?

My email address is thomas.wong@dymocks.com.au

Regards,

Thomas

Exchange 2016 Personal Tags to Mailbox Subfolders via EWS

$
0
0

We have recently migrated from 2010 to 2016 and, unbeknownst to us, the retention policies now apply to subfolders of default mail folders.  Now we have  to find a way to not delete the important historical user emails that have historically been placed in subfolders. 

I have been reading that you can assign Retention Policies to mailbox folders with EWS but can one assign person tag to subfolders inside a mailbox prior to assigning MRM on default folders?  If so, has anyone been able to accomplish this and how?


Soap API GetUserAvailabilityRequest returning incorrect MergedFreeBusy

$
0
0

Hello,

Our team came across an inconsistency in the response of the methodGetUserAvailabilityRequest, using delegation, after creating and deleting an appointment using the Soap API.

The steps to reproduce the misbehavior we found are the following:

  1. For simplicity, find a day with no appointments in an email account's calendar handle by delegation
  2. Verify availability (GetUserAvailabilityRequest)
  3. Create an appointment in that calendar (CreateItem)
  4. Verify the appointment has been actually created (GetUserAvailabilityRequest)
  5. Delete the recently created appointment (DeleteItem)
  6. Verify the appointment has been actually deleted (GetUserAvailabilityRequest)

 

Current result: At this point, the free-busy result seems to be inaccurate and shows some busy slots that should be free.

Expected result: A day with no appointments.

 

It is worth to mention that the appointment is removed from the calendar, i.e. Outlook/OWA calendar. However, if we make a request for getting a user availability, the response is not updated.

 

Here are the requests we are executing when performing these tasks.

 

GetUserAvailabilityRequest

 

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"

                                    xmlns:typ="http://schemas.microsoft.com/exchange/services/2006/types"

                                    xmlns:mes="http://schemas.microsoft.com/exchange/services/2006/messages">

    <soapenv:Header>

                              <typ:RequestServerVersion Version="Exchange2007_SP1"/>

               </soapenv:Header>

               <soapenv:Body>

                              <mes:GetUserAvailabilityRequest>

                                            <!--Optional:-->

                                            <typ:TimeZone>

                                                           <typ:Bias>300</typ:Bias>

                                                           <typ:StandardTime>

                                                                          <typ:Bias>0</typ:Bias>

                                                                          <typ:Time>02:00:00</typ:Time>

                                                                          <typ:DayOrder>1</typ:DayOrder>

                                                                          <typ:Month>11</typ:Month>

                                                                          <typ:DayOfWeek>Sunday</typ:DayOfWeek>

                                                           </typ:StandardTime>

                                                           <typ:DaylightTime>

                                                                          <typ:Bias>-60</typ:Bias>

                                                                          <typ:Time>02:00:00</typ:Time>

                                                                          <typ:DayOrder>2</typ:DayOrder>

                                                                          <typ:Month>3</typ:Month>

                                                                          <typ:DayOfWeek>Sunday</typ:DayOfWeek>

                                                           </typ:DaylightTime>

                                            </typ:TimeZone>

                                            <mes:MailboxDataArray>

                                                           <!--Zero or more repetitions:-->

                                                           <typ:MailboxData>

                                                                          <typ:Email>

                                                                                         <typ:Address>365test2@ttops.onmicrosoft.com</typ:Address>

                                                                          </typ:Email>

                                                                          <typ:AttendeeType>Organizer</typ:AttendeeType>

                                                           </typ:MailboxData>

                                            </mes:MailboxDataArray>

                                            <!--Optional:-->

                                            <typ:FreeBusyViewOptions>

                                                           <typ:TimeWindow>

                                                                          <typ:StartTime>2018-11-20T00:00:00</typ:StartTime>

                                                                          <typ:EndTime>2018-11-21T00:00:00</typ:EndTime>

                                                           </typ:TimeWindow>

                                                           <typ:RequestedView>MergedOnly</typ:RequestedView>

                                            </typ:FreeBusyViewOptions>

                              </mes:GetUserAvailabilityRequest>

               </soapenv:Body>

</soapenv:Envelope>

 

 

CreateItem

 

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"

                  xmlns:typ="http://schemas.microsoft.com/exchange/services/2006/types"

                  xmlns:mes="http://schemas.microsoft.com/exchange/services/2006/messages">

    <soapenv:Header>

        <typ:RequestServerVersion Version="Exchange2007_SP1"/>

    </soapenv:Header>

    <soapenv:Body>

        <mes:CreateItem MessageDisposition="SaveOnly" SendMeetingInvitations="SendToNone">

            <mes:SavedItemFolderId>

                <typ:DistinguishedFolderId Id="calendar">

                    <typ:Mailbox>

                        <typ:EmailAddress>email_account@domain.com</typ:EmailAddress>

                    </typ:Mailbox>

                </typ:DistinguishedFolderId>

            </mes:SavedItemFolderId>

            <mes:Items>

                <typ:CalendarItem>

                    <typ:Subject>Test appointment</typ:Subject>

                    <typ:Body BodyType="Text">Body text</typ:Body>

                    <typ:ReminderIsSet>true</typ:ReminderIsSet>

                    <typ:ReminderMinutesBeforeStart>10</typ:ReminderMinutesBeforeStart>

                    <typ:Start>2018-11-20T18:00:00Z</typ:Start>

                    <typ:End>2018-11-20T20:00:00Z</typ:End>

                    <typ:Location>My Office</typ:Location>

                    <typ:IsResponseRequested>false</typ:IsResponseRequested>

                </typ:CalendarItem>

            </mes:Items>

        </mes:CreateItem>

    </soapenv:Body>

</soapenv:Envelope>

 

 

DeleteItem

 

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"

                  xmlns:typ="http://schemas.microsoft.com/exchange/services/2006/types"

                  xmlns:mes="http://schemas.microsoft.com/exchange/services/2006/messages">

    <soapenv:Header>

        <typ:RequestServerVersion Version="Exchange2007_SP1"/>

    </soapenv:Header>

    <soapenv:Body>

        <mes:DeleteItem DeleteType="SoftDelete" SendMeetingCancellations="SendToAllAndSaveCopy" AffectedTaskOccurrences="AllOccurrences">

            <mes:ItemIds>

                <typ:ItemId Id="itemid_previously_created" ChangeKey="DwAAABYAAAD"/>

            </mes:ItemIds>

        </mes:DeleteItem>

    </soapenv:Body>

</soapenv:Envelope>

 

NOTE: The item ID and ChangeKey have been shortened to preserve readability.

 

 

We are interested in a portion of the reponse: MergedFreeBusy.

 

By executing these requests  in the order mentioned above, we get the following responses:

 

  1. Verify availability before creating appointments

<MergedFreeBusy xmlns="http://schemas.microsoft.com/exchange/services/2006/types">000000000000000000000000000000000000000000000000</MergedFreeBusy>

  1. CreateItem
  2. Verify availability after creating an appointment

<MergedFreeBusy xmlns="http://schemas.microsoft.com/exchange/services/2006/types">000000000000000000000000002222000000000000000000</MergedFreeBusy>

  1. DeleteItem
  2. Verify availability after deleting the appointment

<MergedFreeBusy xmlns="http://schemas.microsoft.com/exchange/services/2006/types">000000000000000000000000002222000000000000000000</MergedFreeBusy>

 

Waiting for the server to update the information does not seem to work. Once we get to this inconsistency, it remains in time.

 

Additionally, if we create or modify a calendar item, e.g. if we create an appointment the same day but an hour before and we check for the availability, we get the right result.

We believe there is an issue with either the API or the 365 server not updating. Outlook shows the appointment as correctly deleted, but theGetUserAvailabilityRequest SOAP API method returns the timeslot as unavailable even after it has been deleted.    We believe this is a bug with the API.     

Are there any workarounds for this issue?  Is there an (undocumented?) API call to "refresh" the server so that it returns the correct freebusy string?

Any help appreciated.


[EWSJA][Java]: Certificate authentication

$
0
0

I have been requested to implement a client for EWS that should work with Certificate authentication.

But that seems not to be an option now, since the service claims all it supports is authentication through NTLM/Password/Oauth. I see some reference to Certificate authentication but that seems to be deprecated or at least not available in the Java API anymore.

So is there a way to authenticate a user through certificates? or does that mean that I need to have the domain network (or Oauth) setup to test this?

Or is it a way to accomplish this with some other API service implementation?

Outlook Calendar REST API to access on-premise Exchange server

$
0
0

Hello,

I'm creating an ASP.NET Core application that should implement the functionality of letting a user see other users calendar-appointments in a scheduler.

All users and their calendar-information is on an on-premise exchange server 2016 and now I'm trying to figure out what alternatives I have to accomplish this.

From what I have understood, there are one way to approach this, but potentially two? I realize that I can use the EWS Managed API in my application to retrieve calendar-appointment-information to show in the scheduler. But can I also use the Outlook Calendar REST API to accomplish this?

I have looked at https://msdn.microsoft.com/en-us/office/office365/api/calendar-rest-operations to try and figure out how to use this with the work-email-addresses that are located on the Exchange-server. But we don't have Office 365 or Exchange online. Can the Outlook REST API still be used to accomplish this? And if that's the case - where can I find out how to do it?

Thank you in advance

Best regards Isak

Exchange2016: Using OWA internally: request for 7 JS Files from appsforoffice.microsoft.com

$
0
0

Hi there,

i have a customer with a lot of users that have no internet access. This is done via proxy authentication.

When using OWA internally, these users have a proxy auth window popping up (or in case of IE: 7 of them) because OWA loads seven JS scripts from an external source. I could reproduce the behaviour using our own Exchange 2013, it's the same behaviour, only the filename loading them differs.

File: microsoft.owa.extensibilitynext.js (microsoft.exchange.clients.owa2.client.extensibility.js in 2013)
Requests: 
https://appsforoffice.microsoft.com/lib/1/hosted/office.js
https://appsforoffice.microsoft.com/lib/1/hosted/en-us/outlook_strings.js
https://appsforoffice.microsoft.com/lib/1/hosted/en-us/office_strings.js
https://appsforoffice.microsoft.com/lib/1/hosted/de-de/office_strings.js
https://appsforoffice.microsoft.com/lib/1/hosted/de-de/outlook_strings.js
https://appsforoffice.microsoft.com/lib/1/hosted/outlook-web-16.00.js
https://appsforoffice.microsoft.com/lib/1/hosted/outlook-web-16.01.js

I disabled all Apps in Exchange and changed the policy to NoApps and NoCustomApps but to no avail. As soon as a user displays a message in OWA, that script is loaded and requests those online JS.

Is there a way to use OWA completely offline? Due to company restrictions allowing access to that Hostname bypassing the proxy is no option.

Any Ideas? Thanks for any input.

Regards,
Thomas


How to get attachments data from EWS Managed API 2.2 with authentication token

$
0
0

i am trying to get attachment data by using EWS Managed API 2.2. i use attachment id and authentication token which obtained from Office.context.mailbox.getCallbackTokenAsync() method in office javascript api 1.1.i use following code with asp.net web api project
An error occur when calling service.GetAttachments(). here is code and exception detail 

    ExchangeService service = new ExchangeService();
            service.Credentials = new OAuthCredentials(rawToken);
            service.Url = new Uri(EwsUrl);

            var attachmentIds = new List<string>();
            attachmentIds.Add("AuwSuuu...dLIw=");

            var getAttachmentsResponse =
              service.GetAttachments(attachmentIds.ToArray(),
                                     null,
                                     new PropertySet(BasePropertySet.FirstClassProperties,
                                                     ItemSchema.MimeContent));

            if (getAttachmentsResponse.OverallResult == ServiceResult.Success)
            {
                 //
                
            } 

Exception details

<ExceptionMessage>
Method not found: 'Microsoft.Exchange.WebServices.Data.ServiceResponseCollection`1<Microsoft.Exchange.WebServices.Data.GetAttachmentResponse> Microsoft.Exchange.WebServices.Data.ExchangeService.GetAttachments(System.String[], System.Nullable`1<Microsoft.Exchange.WebServices.Data.BodyType>, System.Collections.Generic.IEnumerable`1<Microsoft.Exchange.WebServices.Data.PropertyDefinitionBase>)'.
</ExceptionMessage>
<ExceptionType>System.MissingMethodException</ExceptionType>

  
Viewing all 7132 articles
Browse latest View live


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