DSN code 5.1.1 in Exchange Online delivery failed

I've seen many questions about this error and can't seem to get a suitable solution for my situation, I attempted to install office 365 in a hybrid mode and abandoned the attempt after having various issues. I removed all connections and configurations with the
on premise server and I have two domains, one is my on premise one is only office 365 now. when I log onto my office 365 account and try to email my other on premise domain I get this error, the email address I'm mailing is not on Office 365 but office
365 online seems to think it is, I've tried all the clearing cache, same thing happens whether I use chrome or internet explorer, when I configure my office 365 in outlook 2013 I can send email to it, I can even email the account when sending from
outlook lite using online 365 just not the un-lite version. I've deleted all mail from my office 365 account, deleted all contacts, reset the recent cache many times.
My DNS for office 365 account is setup according to Microsoft recommendation, my dns for on premise has not been changed to reflect anything being in office 365.
I can email my on premise accounts from anywhere except my office 365 online non-lite outlook web app. I can even email it form other office 365 accounts.
I removed personal info from the following
Delivery has failed to these recipients or groups:
<email Address>
 The email address you entered couldn't be found. Check the recipient's email address then try to resend the message. For more tips to resolve this issue see
DSN code 5.1.1 in Exchange Online. If the problem continues contact your help desk.
Diagnostic information for administrators:
Generating server: CO2PR0501MB1079.namprd05.prod.outlook.com
IMCEAEX-_o=ExchangeLabs_ou=Exchange+20Administrative+20Group+20+28FYDIBOHF23SPDLT+29_cn=Recipients_cn=3a963b352729491c9140a11d3300c095-<name>[email protected]
Remote Server returned '550 5.1.1 RESOLVER.ADR.ExRecipNotFound; not found'
Original message headers:
Received: from CO2PR0501MB1077.namprd05.prod.outlook.com (25.160.7.22) by
CO2PR0501MB1079.namprd05.prod.outlook.com (25.160.7.24) with Microsoft SMTP
Server (TLS) id 15.0.949.11; Thu, 12 Jun 2014 12:49:47 +0000
Received: from CO2PR0501MB1077.namprd05.prod.outlook.com ([25.160.7.22]) by
CO2PR0501MB1077.namprd05.prod.outlook.com ([25.160.7.22]) with mapi id
15.00.0949.001; Thu, 12 Jun 2014 12:49:47 +0000
Content-Type: application/ms-tnef; name="winmail.dat"
Content-Transfer-Encoding: binary
From: Darren Blanchard <[email protected]>
To: Darren Blanchard <[email protected]>
Subject: dfgddfgdfg
Thread-Topic: dfgddfgdfg
Thread-Index: AQHPhjzKzGKiXAQnXE+9tNdjn1VLUA==
Date: Thu, 12 Jun 2014 12:49:46 +0000
Message-ID: <[email protected]tlook.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator: <[email protected]tlook.com>
MIME-Version: 1.0
X-Originating-IP: {xxx.xxx.xxx.xxx]
Return-Path: [email protected]
X-Microsoft-Antispam:
BL:0;ACTION:Default;RISK:Low;SCL:0;SPMLVL:NotSpam;PCL:0;RULEID:

According to the information you provided, since you can email to these recipients without issue when using the other clients, the issue may be related to the cache in OWA (Outlook Web App). To solve the issue, I suggest you try the following steps:
Log into OWA, click “new mail” to compose a new message.
In the “To:” tab, type the first letter of email address for the recipient, if it’s cached in OWA before, there will be a drop down list popping up. If so, please move the mouse on the mail address in the drop down list, then press the Delete key to delete
the cache. If however you don’t see the drop down list when typing the user’s email address, please continue the following steps.
Log into EAC (Exchange Admin Center), click “recipients”—“contacts”.
Create a new contact using the external email address, this make sure the user is added as an external contact in the global address list.
Back to OWA, in the new mail window, click the add icon in the right corner of the To tab.
In the pop-up window, click the “>>” icon, under the Directory tab, click “Offline Global Address List”, then select the contact we just created. Send the message out, then check if the issue persists.

Similar Messages

  • [Exchange-Online][EWS-XML][JAVA][OAUTH2] Getting HTTP status code 500 when using OAUTH2 client credential grant flow as authorization method

    Hi,
    i'm working on enhancing a service to be able to use OAUTH2 as authentication protocol with client credential grant flow when talking to exchange online ( like described here:
    http://blogs.msdn.com/b/exchangedev/archive/2015/01/22/building-demon-or-service-apps-with-office-365-mail-calendar-and-contacts-apis-oauth2-client-credential-flow.aspx ). I gave my application the rights 
    Office 365 Exchange Online : Application Permissions: "Have full access via EWS to all mailboxes ....."
    Windows Azure Active AD: Application Permissions: "Read Directory data", Delegate Permissions: "Enable sign-on and read users_ profiles" 
    I receive a access token from log.windows.net:
    decoded token:
     typ: "JWT",
     alg: "RS256",
     x5t: "MnC_VZcATfM5pOYiJHMba9goEKY"
     aud: "https://outlook.office365.com/",
     iss: "https://sts.windows.net/<TENANT_ID>/",
     iat: 1426584502,
     nbf: 1426584502,
     exp: 1426588402,
     ver: "1.0",
     tid: "<TENANT_ID>",
     roles: [
      "full_access_as_app"
     oid: "1ddbdc11-b80d-4d1d-91b9-5b07a6b82659",
     sub: "1ddbdc11-b80d-4d1d-91b9-5b07a6b82659",
     idp: "https://sts.windows.net/TENANT_ID/",
     appid: "<APP_ID_IN_AZURE_AD>",
     appidacr: "2"
    <SIGNATURE>
    If i use that token then to send a EWS XML to exchange online i get a 500 HTTP status code back:
    With impersonation in the request:
    [http.wire ]: >> "POST /EWS/Exchange.asmx HTTP/1.1[\r][\n]"
    [http.wire ]: >> "Authorization: Bearer <MY_ACCESS_TOKEN>[\r][\n]"
    [http.wire ]: >> "SoapAction: "http://schemas.microsoft.com/exchange/services/2006/messages/GetFolder"[\r][\n]"
    [http.wire ]: >> "Content-Type: text/xml; charset=utf-8[\r][\n]"
    [http.wire ]: >> "User-Agent: OpenScapeUC EWS HttpClient/3.0[\r][\n]"
    [http.wire ]: >> "client-request-id: 5b2c7e1a-656d-4f43-bd34-ea2d6290611f[\r][\n]"
    [http.wire ]: >> "Date: Tue, 17 Mar 2015 10:08:17 GMT[\r][\n]"
    [http.wire ]: >> "Content-Length: 1189[\r][\n]"
    [http.wire ]: >> "Host: outlook.office365.com[\r][\n]"
    [http.wire ]: >> "Connection: Keep-Alive[\r][\n]"
    [http.wire ]: >> "[\r][\n]"
    [http.wire ]: >> "<?xml version="1.0" ?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"><S:Header><ns2:ExchangeImpersonation xmlns:ns2="http://schemas.microsoft.com/exchange/services/2006/types"
    xmlns:ns3="http://schemas.microsoft.com/exchange/services/2006/messages"><ns2:ConnectingSID><ns2:PrimarySmtpAddress><THE_MAILBOX_I_WANT_TO_ACCESS></ns2:PrimarySmtpAddress></ns2:ConnectingSID></ns2:ExchangeImpersonation><ns2:RequestServerVersion
    xmlns:ns2="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:ns3="http://schemas.microsoft.com/exchange/services/2006/messages" Version="Exchange2007_SP1"/></S:Header><S:Body><ns3:GetFolder xmlns:ns2="http://schemas.microsoft.com/exchange/services/2006/types"
    xmlns:ns3="http://schemas.microsoft.com/exchange/services/2006/messages"><ns3:FolderShape><ns2:BaseShape>IdOnly</ns2:BaseShape><ns2:AdditionalProperties><ns2:FieldURI FieldURI="folder:FolderId"/></ns2:AdditionalProperties></ns3:FolderShape><ns3:FolderIds><ns2:DistinguishedFolderId
    Id="contacts"><ns2:Mailbox><ns2:EmailAddress><THE_MAILBOX_I_WANT_TO_ACCESS></ns2:EmailAddress></ns2:Mailbox></ns2:DistinguishedFolderId></ns3:FolderIds></ns3:GetFolder></S:Body></S:Envelope>"
    [http.wire ]: << "HTTP/1.1 500 Internal Server Error[\r][\n]"
    [http.wire ]: << "Cache-Control: private[\r][\n]"
    [http.wire ]: << "Content-Type: text/xml; charset=utf-8[\r][\n]"
    [http.wire ]: << "Server: Microsoft-IIS/8.0[\r][\n]"
    [http.wire ]: << "request-id: ec42b5c5-f8dc-498d-ae16-d851a852058c[\r][\n]"
    [http.wire ]: << "Set-Cookie: ClientId=<DELETED>; expires=Wed, 16-Mar-2016 10:08:17 GMT; path=/; secure; HttpOnly[\r][\n]"
    [http.wire ]: << "X-CalculatedBETarget: am2pr02mb0387.eurprd02.prod.outlook.com[\r][\n]"
    [http.wire ]: << "X-DiagInfo: AM2PR02MB0387[\r][\n]"
    [http.wire ]: << "X-BEServer: AM2PR02MB0387[\r][\n]"
    [http.wire ]: << "X-AspNet-Version: 4.0.30319[\r][\n]"
    [http.wire ]: << "Set-Cookie: exchangecookie=<DELETED>; expires=Thu, 17-Mar-2016 10:08:17 GMT; path=/; HttpOnly[\r][\n]"
    [http.wire ]: << "Set-Cookie: [email protected]=<DELETED>; expires=Thu, 16-Apr-2015 10:08:18 GMT; path=/EWS; secure; HttpOnly[\r][\n]"
    [http.wire ]: << "Set-Cookie: [email protected]=<DELETED>; expires=Thu, 16-Apr-2015 10:08:18 GMT; path=/EWS; secure; HttpOnly[\r][\n]"
    [http.wire ]: << "X-Powered-By: ASP.NET[\r][\n]"
    [http.wire ]: << "X-FEServer: DB5PR01CA0064[\r][\n]"
    [http.wire ]: << "Date: Tue, 17 Mar 2015 10:08:17 GMT[\r][\n]"
    [http.wire ]: << "Content-Length: 891[\r][\n]"
    [http.wire ]: << "Accept-Ranges: none[\r][\n]"
    [http.wire ]: << "Connection: keep-alive[\r][\n]"
    [http.wire ]: << "[\r][\n]"
    Without impersonation in the request:
    Request
    [http.wire ]: >> "POST /EWS/Exchange.asmx HTTP/1.1[\r][\n]"
    [http.wire ]: >> "Authorization: Bearer <MY_ACCESS_TOKEN>[\r][\n]"
    [http.wire ]: >> "SoapAction: "http://schemas.microsoft.com/exchange/services/2006/messages/GetFolder"[\r][\n]"
    [http.wire ]: >> "Content-Type: text/xml; charset=utf-8[\r][\n]"
    [http.wire ]: >> "User-Agent: OpenScapeUC EWS HttpClient/3.0[\r][\n]"
    [http.wire ]: >> "client-request-id: 20bd722f-8276-4ebb-8d58-ce45d31f3ed4[\r][\n]"
    [http.wire ]: >> "Date: Tue, 17 Mar 2015 09:33:24 GMT[\r][\n]"
    [http.wire ]: >> "Content-Length: 871[\r][\n]"
    [http.wire ]: >> "Host: outlook.office365.com[\r][\n]"
    [http.wire ]: >> "Connection: Keep-Alive[\r][\n]"
    [http.wire ]: >> "[\r][\n]"
    [http.wire ]: >> "<?xml version="1.0" ?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"><S:Header><ns2:RequestServerVersion xmlns:ns2="http://schemas.microsoft.com/exchange/services/2006/types"
    xmlns:ns3="http://schemas.microsoft.com/exchange/services/2006/messages" Version="Exchange2007_SP1"/></S:Header><S:Body><ns3:GetFolder xmlns:ns2="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:ns3="http://schemas.microsoft.com/exchange/services/2006/messages"><ns3:FolderShape><ns2:BaseShape>IdOnly</ns2:BaseShape><ns2:AdditionalProperties><ns2:FieldURI
    FieldURI="folder:FolderId"/></ns2:AdditionalProperties></ns3:FolderShape><ns3:FolderIds><ns2:DistinguishedFolderId Id="contacts"><ns2:Mailbox><ns2:EmailAddress><THE_MAILBOX_I_WANT_TO_ACCESS></ns2:EmailAddress></ns2:Mailbox></ns2:DistinguishedFolderId></ns3:FolderIds></ns3:GetFolder></S:Body></S:Envelope>"
    Response:
    [http.wire ]: << "HTTP/1.1 500 Internal Server Error[\r][\n]"
    [http.wire ]: << "Cache-Control: private[\r][\n]"
    [http.wire ]: << "Content-Type: text/xml; charset=utf-8[\r][\n]"
    [http.wire ]: << "Server: Microsoft-IIS/8.0[\r][\n]"
    [http.wire ]: << "request-id: 923ba463-490f-4ac9-a496-993cd8a44115[\r][\n]"
    [http.wire ]: << "Set-Cookie: ClientId=<DELETED>; expires=Wed, 16-Mar-2016 09:33:24 GMT; path=/; secure; HttpOnly[\r][\n]"
    [http.wire ]: << "X-CalculatedBETarget: am2pr02mb0387.eurprd02.prod.outlook.com[\r][\n]"
    [http.wire ]: << "X-DiagInfo: AM2PR02MB0387[\r][\n]"
    [http.wire ]: << "X-BEServer: AM2PR02MB0387[\r][\n]"
    [http.wire ]: << "X-AspNet-Version: 4.0.30319[\r][\n]"
    [http.wire ]: << "Set-Cookie: exchangecookie=<DELETED>; expires=Thu, 17-Mar-2016 09:33:25 GMT; path=/; HttpOnly[\r][\n]"
    [http.wire ]: << "Set-Cookie: [email protected]=<DELETED>; expires=Thu, 16-Apr-2015 09:33:25 GMT; path=/EWS; secure; HttpOnly[\r][\n]"
    [http.wire ]: << "Set-Cookie: [email protected]=<DELETED>; expires=Thu, 16-Apr-2015 09:33:25 GMT; path=/EWS; secure; HttpOnly[\r][\n]"
    [http.wire ]: << "X-Powered-By: ASP.NET[\r][\n]"
    [http.wire ]: << "X-FEServer: AM3PR07CA0038[\r][\n]"
    [http.wire ]: << "Date: Tue, 17 Mar 2015 09:33:24 GMT[\r][\n]"
    [http.wire ]: << "Content-Length: 799[\r][\n]"
    [http.wire ]: << "Accept-Ranges: none[\r][\n]"
    [http.wire ]: << "Connection: keep-alive[\r][\n]"
    If i use BASIC authentication and impersonation the request is successfully. 
    Has anyone an idea why i might get the error 500 in that scenario?

    For EWS to work with App Token, you need to do two more things. One you already did: Set the impersonation header. Two is to set the X-AnchorMailbox http request header to the smtp address of the mailbox you want to access. This routes the request instantly
    to the right backend.
    Hope this helps.
    Thank you! Matthias

  • Connecting to Exchange Online using module vs. manually : module wont work

    I'm nearly at my wits' end. 
    I have installed MSOnline, and Active Directory modules for PS 3.0.
    I've created a PS module which contains a function, "connect-exchange" which simply gets my credentials, creates a new session for Microsoft Exchange online, then connects to MSonline and imports the PSsession for exchange. I run PS as administrator
    (windows 7), set-executionpolicy unsigned, open $profile and add in the modules I'll use most (Active Directory, MS Online, and my custom module). I run PS as my normal user, and get-module reports all three modules are loaded, including my custom one. I run
    the function "connect-exchange" and it goes as expected. I am redirected to two URI's and a Module name is listed with exported commands pertinent to managing Exchange Online. Great. The problem is that
    none of the cmdlets work, and the Exchange Online tmp module does not show up in get-module.
    The kicker is that If I open my custom module with the connect-exchange function, highlight the actual commands in the function and run them manually, everything works properly. 
    Letting PS do the module makes it appear to work, except nothing related to my exchange session shows up in get-module, and none of the cmdlets are available. Manually running the exact same code that is in the module makes it work.
    This is my custom module, which loads when I start powershell:
    Function Connect-Exchange()
    $cred = Get-Credential
    $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell/ -Credential $cred -Authentication Basic -AllowRedirection
    Connect-MsolService -Credential $cred
    Import-PSSession $Session
    Running "connect-exchange" does connect, and this is the output (it is identical to the output as when I run the commands in the function manually, as would normally be expected):
    PS H:\> Connect-Exchange
    cmdlet Get-Credential at command pipeline position 1
    Supply values for the following parameters:
    WARNING: Your connection has been redirected to the following URI: "https://pod51009psh.outlook.com/powershell-liveid?PSVersion=3.0 "
    WARNING: Your connection has been redirected to the following URI: "https://by2prd0412psh.outlook.com/powershell-liveid?PSVersion=3.0 "
    ModuleType Name ExportedCommands
    Script tmp_j1a0we4q.sad {Add-AvailabilityAddressSpace, Add-DistributionGroupMember, Add-MailboxFolderPermiss...
    Get-module doesn't give me this module, tmp_j1a0we4q.sad. No Script modules are listed that give me any exchange exported commands. Get-PSsession shows 1 session, opened with Microsoft.Exchange . No exchange online cmdlets are available to me at this point
    (including any of the ExportedCommands listed above).
    If I remove the session, open the custom module (listed at the top of this message), highlight the code in the connect-exchange function, then F8, I get the exact same output as the 2nd box listed above, but my exchange cmdlets are available and usable.
    Any ideas why the function which is part of a module which is imported at the start of each PS session does not seem to work the same as running the commands in the function independently?

    Hey Ben,
    http://msdn.microsoft.com/en-us/library/windows/desktop/dd878284%28v=vs.85%29.aspx will probably give you a hint.
    "When a module is imported, a new session state is created for the module, and a
    PSModuleInfo object is created in memory. A session-state is created for each module that is imported (this includes the root module and any nested modules). The members that are exported from the root module, including any members that were exported to
    the root module by any nested modules, are then imported into the caller’s session state."
    Perhaps, because that module has it's own session, it's modules are being missed or are precluded from being imported into subsequent sessions. I do something very similar to you, except I just include the Connect-Exchange function in my profile.ps1 directly
    instead of creating a custom module.
    Good luck!
    Shane

  • Retrieval of all users in Exchange online

    Exchange Version: Exchange Online at Office 365
    API Name: EWS API 2.0
    IDE: Visual basic C# 2010
    Targeted features: Impersonation and retrieval of all users
    Hi there, I am currently developing a program that uses impersonation and queries the EWS API to retrieve emails and their attachments from users. I have used the C# codes from the MSDN Library to develop the program. The program is successful in retrieving
    the emails from specific users that are hard coded into the program.
    The code below shows the process of authenticating the admin user and the impersonation is done in the  RetrieveEmailFromUser() function.
    ServicePointManager.ServerCertificateValidationCallback = CertificateValidationCallBack;
    ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2013_SP1);
    service.Credentials = new NetworkCredential("adminemail@", "password", "domain.onmicrosoft.com");
    service.AutodiscoverUrl("adminemail", RedirectionUrlValidationCallback);
    List<string> emailaddrlist = new List<string>();
    emailaddrlist.Add("[email protected]");
    emailaddrlist.Add("[email protected]");
    foreach (string item in emailaddrlist)
    string content = RetrieveEmailFromUser(service, item);
    Console.WriteLine(content);
            static string RetrieveEmailFromUser(ExchangeService service, string emailAddr)
                service.ImpersonatedUserId = new ImpersonatedUserId(ConnectingIdType.SmtpAddress, emailAddr);
                FindItemsResults<Item> findResults = service.FindItems(WellKnownFolderName.Inbox, new ItemView(50));
    As can be seen from the coding, the users that are to be impersonated have been hardcoded. I would like to know if there are any C# codes or a link to a page where it describes how I can retrieve ALL users with mailboxes from a Microsoft 365 admin account
    without needing to manually add users for retrieval.

    Hi there sorry for asking again but I have successfully retrieved all the users but now I would need to filter them to lower the amount of addresses retrieved.
    For example
    owershell.Runspace = runspace;
    //Create the command and add the parameters to retrieve all users that have mailboxes
    powershell.AddCommand("Get-Mailbox");
    powershell.AddParameter("RecipientTypeDetails", "UserMailbox");
    //Invoke the command and store the results in a PSObject collection
    Collection<PSObject> EmailList = powershell.Invoke();
    //Iterate through the results and add the PrimarySMTP address for each mailbox to emailAddrlist
    foreach (PSObject emailAddr in EmailList)
    string time = emailAddr.Properties["WhenCreated"].Value.ToString();
    string addr = emailAddr.Properties["PrimarySmtpAddress"].Value.ToString();
    EmailAddrList.Add(addr + time);
    The property ("WhenChanged") will retrieve the date time when the mailbox had its options MODIFIED but not when an email is received. Is there a parameter I can input using powershell to retrieve users who have new emails in their mailboxes from
    a specific? Or can I change the value of the Property from  ("WhenChanged") to something else that will give me a date time of the most recent addition of an email to the mailbox. This will then allow me to compare the date time to filter out
    addresses which have not received any emails.
    Thank you.

  • [office365 Exchange online][MVC5][EWS Managed Api] Need a hack to get access token ?

    Hi there, I am using following code example to get access token from Azure AD online. I need to bridge EWS managed api with office 365 Api via Azure AD. The below code is working just fine in my MVC application but I am looking for a way to get the access
    token in simple string returning  function so that I can use it to make call against EWS mananged api.
    private static string tempToken = "";
    public static string GetAccessToken()
    return tempToken;
    internal static async Task<OutlookServicesClient> EnsureOutlookServicesClientCreatedAsync(string capabilityName)
    var signInUserId = ClaimsPrincipal.Current.FindFirst(ClaimTypes.NameIdentifier).Value;
    var userObjectId = ClaimsPrincipal.Current.FindFirst("http://schemas.microsoft.com/identity/claims/objectidentifier").Value;
    AuthenticationContext authContext = new AuthenticationContext(Settings.Authority, new NaiveSessionCache(signInUserId));
    try
    DiscoveryClient discClient = new DiscoveryClient(Settings.DiscoveryServiceEndpointUri,
    async () =>
    var authResult = await authContext.AcquireTokenSilentAsync(Settings.DiscoveryServiceResourceId,
    new ClientCredential(Settings.ClientId,
    Settings.AppKey),
    new UserIdentifier(userObjectId,
    UserIdentifierType.UniqueId));
    return authResult.AccessToken;
    var dcr = await discClient.DiscoverCapabilityAsync(capabilityName);
    return new OutlookServicesClient(dcr.ServiceEndpointUri,
    async () =>
    var authResult = await authContext.AcquireTokenSilentAsync(dcr.ServiceResourceId,
    new ClientCredential(Settings.ClientId,
    Settings.AppKey),
    new UserIdentifier(userObjectId,
    UserIdentifierType.UniqueId));
    return authResult.AccessToken;
    catch (AdalException exception)
    //Handle token acquisition failure
    if (exception.ErrorCode == AdalError.FailedToAcquireTokenSilently)
    authContext.TokenCache.Clear();
    return null;
    This is an excerpt from Microsoft single tenant application in MVC5.  In the code, I have created a function called GetAccessToken() which does nothing.. I am hoping you experts can help me figure out how to transfer the accessToken from EnsureOutlookServcesClientCreated
    function which is actually returning token, to  my GetAccessToken() so that I can make call against EWS managed Api. Sorry, If I sound pretty stupid but I really need your help in this regard. 
    best regards,

    Yes sir, Let me try to explain me about my scenario. I need to use EWS managed Api with office 365 Rest Api to get benefits from both the Apis. Here is here code I am using to connect to EWS managed Api but it is failing with 401:Unauthorized.  I already
    have "Full Access" turned on in Azure AD.  I have the access token from AZure AD and want to use it to make call against EWS managed Api.
    var outlookClient = await AuthHelper.EnsureOutlookServicesClientCreatedAsync("Mail");
    //IPagedCollection<IMessage> messagesResults = await outlookClient.Me.Messages.ExecuteAsync();
    // Get the ID of the first message.
    // string messageId = messagesResults.CurrentPage[0].Id;
    string tokenx = AuthHelper.GetAccessToken();
    ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2013);
    service.HttpHeaders.Add("Authorization", "Bearer " + tokenx);
    service.PreAuthenticate = true;
    service.SendClientLatencies = true;
    service.EnableScpLookup = false;
    service.Url = new Uri("https://outlook.office365.com/EWS/Exchange.asmx");
    // Get all the folders in the message's root folder.
    ExFolder rootfolder = ExFolder.Bind(service, WellKnownFolderName.MsgFolderRoot);S
    Scenario of my migration application:
    1. I have a Gmail mailbox email in Raw(complete email in base64-urlsafe with attachments) format with RFC2822. I need to migrate this mailbox to Exchange online. I believe EWS managed Api has better support on this one.
    2.  Likewise I need to migrate Gmail Calendars, Tasks and Contacts to Exchange online.
    I would be highly grateful to you , if you tell me how to bridge EWS managed Api with office 365 Api.
    best regards,

  • [Exchange-Online][EWS][C#][Windows]: How do I mark all mails in a folder as read?

    Hi,
    I'm developing a C# application in Visual Studio 2013 Pro Update 2 to query an Exchange Online mailbox folder and read mails into my CRM solution. I can connect without a problem, read mails without a problem, mark individual emails as read without a problem,
    etc. but I don't seem to be able to mark all emails in a specific folder as being un/read.
    I can see that in Exchange 2013 that the following code would do the trick, but it doesn't work for Exchange Online:-
    Folder folder = Folder.Bind(service,folderID);
    folder.MarkAllItemsAsRead(true);
    To mark an individual mail as being read I'm using this code:-
    public void MarkAsRead(ExchangeService exchangeService, ItemId itemID)
    Item mess = Item.Bind(exchangeService, itemID);
    EmailMessage message = mess as EmailMessage;
    message.IsRead = true;
    message.Update(ConflictResolutionMode.AlwaysOverwrite);
    Does anyone know if Exchange Online has a method to mark all mails as read and if so, how do I call it?
    Thanks,
    Mike

    I should probably say that when attempting to call the MarkAllItemsAsRead() method from my code I get the following error:-
    "Microsoft.Exchange.WebServices.Data.ServiceVersionException was caught
      HResult=-2146233088
      Message=Method MarkAllItemsAsRead is only valid for Exchange Server version Exchange2013 or later.
      Source=Microsoft.Exchange.WebServices
      StackTrace:
           at Microsoft.Exchange.WebServices.Data.EwsUtilities.ValidateMethodVersion(ExchangeService service, ExchangeVersion minimumServerVersion, String methodName)
           at Microsoft.Exchange.WebServices.Data.ExchangeService.MarkAllItemsAsRead(FolderId folderId, Boolean readFlag, Boolean suppressReadReceipts)
           at Microsoft.Exchange.WebServices.Data.Folder.MarkAllItemsAsRead(Boolean suppressReadReceipts)
           at Renishaw.EWS.ExchangeWebService.GetEmails(ExchangeService service) in c:\pvcs_gotdotnet\work\CRMEmailProcessing\CRMEmailProcessing\EWS\ExchangeWebService.cs:line 89
           at Renishaw.CRM.Service.EmailManager.ReadEmails() in c:\pvcs_gotdotnet\work\CRMEmailProcessing\CRMEmailProcessing\Service\EMailManager.cs:line 122
      InnerException: "

  • Copy UM settings and prompts from Exchange 2010 to Exchange Online

    When I migrated UM from Exchange 2007 to Exchange 2010, there is a script called "MigrateUMCustomPrompts.ps1"
    that would copy over all the customized greeting files.
    We are now migrating from Exchange 2010 to Exchange Online and will be using Exchange Online UM.  Is there a similar script to copy over the files just like
    the on-prem?

    Sorry, I don't share code examples in most cases because they're generally one-off customer-specific scripts and I'm not in a position to answer lots of follow-up questions about them.
    Ed Crowley MVP "There are seldom good technological solutions to behavioral problems."

  • EWS Manage Api Exchange Online TokenCredentials always returning 401

    Hi,
    Im trying to get acces to Exchange Online with the EWS manage api 2.2 and Im trying using this
    ExchangeService service = new ExchangeService();
    service.TraceEnabled = true;
    service.Url = new Uri("https://outlook.office365.com/EWS/Exchange.asmx");
    //service.HttpHeaders.Add("Authorization", "Bearer " + token);
    service.Credentials = new TokenCredentials(token);
    //service.PreAuthenticate = true;
    //service.SendClientLatencies = true;
    //service.EnableScpLookup = false;
    Always I get 401 unauthorized the token I get Azure Ad Authentication library , with this code
    var authenticationContext = new AuthenticationContext(_config.AuthString, false);
    // Config for OAuth client credentials
    var clientCred = new ClientCredential(_config.ClientId, _config.ClientSecret);
    AuthenticationResult authenticationResult = authenticationContext.AcquireToken(_config.ResourceUrl,clientCred);
    string token = authenticationResult.AccessToken;
    The app is registered on Azure Ad and have all the permision ,
    Im missing something? There is somewhere  a working example?
    I thinks is the same problem that is explained  here
    Live like you'll die tomorrow, learn like you'll live forever.
    Blog

    Got this "nuclear bomb", as i call this type of unexpected issues, in response too.
     {[x-ms-diagnostics, 2000010;reason="The access token is acquired using an authentication method
    that is too weak to allow access for this application. Presented auth strength was 1, required is 2.";error_category="insufficient_auth_strength"]}
    As i see, have to use a trusted certificate via ADAL (not self-signed), i guess, to get prtectio
    level 2.
    But all i initially was need - edit subject of an item at read-view outlook web (content) app...

  • Monitoring many mailboxes in Exchange OnLine

    Hi
    I'm developing a large-scaled Exchange calendar synchronization application using EWS Managed API 2.1. 
    When Microsoft upgraded the Exchange OnLine platform to Exchange 2013 I had to re-write some of the code in order to adapt to the new behavior of the CAS (e.g. subscription groups and GroupingInformation).
    Typically our customers have 4000-5000 mailboxes that we have to monitor but some of them have 20.0000 or more. As the trend is that also large companies are moving their Exchange to the cloud I often get questions from sales about how many calendars
    we can monitor for changes.   
    So, now to my question;
    Is there any absolute limit for how many mailboxes that can be monitored in Exchange OnLine?
    I'm using EWS Managed API 2.1, utilizing Autodiscover, Impersonation, Streaming Notifications and subscription groups (200 subscriptions each). I'm aware of that throttling limits will be reached from time to time and that I have to handle them as they occur.
    Best Regards
    Jens
    Jens Eriksson TalkIT Communication AB

    Hi CCStefanonni,
    If you delete a user account or remove a license from a user, mailbox will be permanently deleted after 30days. Since you are in Midsize Business plan you don't have in-place hold to keep inactive user data for more than 60 days. As I see, you have two options,
    Convert the user mailbox to a Shared Mailbox. Keep in mind shared mailboxes are only 5GB in size.
    Download the PST and keep it somewhere safe (ex: one drive). You can upload the PST through the shell or though Outlook later if needed.
    Thanks

  • Polycom phone won't connect to Exchange Online

    Having an issue with Polycom CX600 connecting to EWS.  Lync 2010 on-prem, Exchange Online.  All Lync and Exchange functions working normally (Lync 2010 client, Outlook 2010, calendar, UM) all good.  CX600 gives error "Microsoft Exchange
    integration unavailable" and "Connection to Exchange is unavailable due to invalid network credentials".  I have updated to code level 4.0.7577.4450.  DNS records (autodiscover.domain.com) and SRV (_autodiscover._tcp.domain.com) point
    to autodiscover.outlook.com.  Reset phone to defaults, re-provisioned using USB cable.  Credentials entered in UPN format.  Fails with both 2010 client on desktop and 2013 client.  Lync client can access history, Voice Mail, Calendar (2013)
    so no problem for client.
    Ideas?
    RJ

    Hi Russ
    Ensure that the ews internal and external url are set correctly.
    Also make sure that you have published reverse proxy for ews as this could be issue as well .
    Also there is a similar issue with regards to the same refer below blog  which mentions the common name and the SAN entries value should be correctly set 
    http://ucken.blogspot.com/2011/09/lync-deskphones-and-exchange.html
    Remember to mark as helpful if you find my contribution useful or as an answer if it does answer your question.That will encourage me - and others - to take time out to help you Check out my latest blog posts on http://exchangequery.com

  • Linking Exchange online calendar to Access

     do voluntary work for a small charity. They have Office 365, but use google mail and calendar for integrated agenda handling. The reason is historic. They have a business system written in MS Access 2010. This system is reaching it's limits and one
    of the main reasons is lack of integration with Google Calendar. I am thinking of switching them to Exchange Online. My question is is this a sensible option, and does anyone have any experience linking Access applications with Outlook/Exchange Online. From
    my first look it doesn't seem to be as easy as it should be, but! I want to be able to drive some parts of the calendar from the Access business system, and vice versa. Really grateful for any help here. thanks guys

    Many thanks George. What I mean by "applications" is that their business system is written in MS Access 2010. We need to upgrade it and integrate their calendar which is used for scheduling jobs and appointments. They currently use Google
    calendar. I thought I had a solution with an interface (RSSBUS), but on further investigation the supplier informed me it would not work, as there are limitations in MS Access which they cannot address (something to do with field sizes). Thus my idea
    of migrating their calendar to Office 365, which they already have installed (but do not use). However, my first look at what I can do with Access by linking a table to Online Exchange calendar doesn't provide the information I need from
    that calendar. The table so produced only contains "inbox" or message data items. I have seen I am far from the first to encounter this problem, and am guessing that many people have found ways around it. I'm guessing it will involve writing
    some code (in VB?) to achieve what I want to. If I have to do this it seems there is little point in migrating them from Google calendar. I was hoping there may be solution out there somewhere. Hope this makes sense.   

  • Return data is null while calling Exchange Online rest api using jquery on Chrome and Mozilla

    Hi,
         I am developing a SharePoint hosted app in which I am calling Exchange online rest api using basic authentication to get mail for the user. This works fine in IE but returns null data when opening in Chrome or Mozilla.
    Is there something I am missing while making rest call to api?
    Please remember to mark your question as answered &Vote helpful,if this solves/helps your problem. Thanks, Ajeet

    Hi,
    This forum is to discuss problems of Office development such as VBA, VSTO, Apps for Office .etc. But I think your question is related to app for SharePoint. I suggest you posting it in
    App for SharePoint forum for more efficient responses.
    Thanks.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Exchange Online Management cmdlets return Display Name instead of Identity

    Hello,
    We've got an issue when managing our Exchange Online environment using remote PowerShell.
    We use Exchange management cmdlets to manage Exchange Online mailboxes. When we run, for example, the
    Get-MailboxPermission or Get-RecipientPermission
    cmdlets, it returns Display Names of the users with mailbox rights. Previously, when we initially tested remote PowerShell with Exchange Online, the cmdlets returned the
    Identity property, which is unique and worked well for us. However, currently the cmdlets return the
    Display Name, which is not unique and causes us issues. For example, in our environment there can exist two or more users with the same Display Name (see highlighted on the screenshot):
    In cases when only one of the users is granted a permission, we cannot distinguish programmatically, which of the 2 users this is. Also, we cannot run cmdlets, such as
    Get-SecurityPrincipal, to get more info about the principals who are granted the permission.
    Is it possible to get the old behavior of the cmdlets back so that they return the unique
    Identity instead of the non-unique Display Name? Or how do we workaround this?

    Hello,
    Can anyone update on this? The issue causes us HUGE problems :(

  • Delivery delayed possibly because of Exchange Online issue with DNS check

    http://social.technet.microsoft.com/Forums/exchange/en-US/newthread?category=microsoftonlineservices&forum=onlineservicesexchange
    I'm troubleshooting extremely late (3+ days) delivery emails FROM a domain hosted by Microsoft TO systemid.com.  Microsoft Remote connectivity analyzer
    https://testconnectivity.microsoft.com/ shows that it cannot get MX record for systemid.com.  HOWEVER, other tools like Mxtoolbox (http://mxtoolbox.com/) shows the
    MX lookup is successful.
    When sending FROM Google / Yahoo to the same email address at systemid.com, the emails go through right away.
    I was able to reproduce the issue by sending an email FROM my personal Hotmail email to systemid.com.  The next morning I got a delayed Delivery Status Notifcation:
    Reporting-MTA: dns;BAY004-OMC1S14.hotmail.com
    Received-From-MTA: dns;BAY169-W65
    Arrival-Date: Tue, 30 Sep 2014 11:38:10 -0700
    Final-Recipient: rfc822;[email protected]
    Action: delayed
    Status: 4.4.7
    Will-Retry-Until: Thu, 2 Oct 2014 11:38:17 -0700
    I think the root issue is that Exchange Online does not like something about MX record for systemid.com, although other tools say the MX records are fine.
    Can you see why emails from Hotmail or one of your Exchange Online customers cannot reach systemid.com although emails from Google / Yahoo go in just fine?  Please PM me if you need the name of the domain hosted by Microsoft or an email address at systemid.com
    for testing.

    If you open a service request via your O365 tenant, and explain the issue, they'll respond quite quickly.
    I've created some tickets at O365 support for about the same problems in the past, and you usually get a call from an EOP/EO engineer the day after.

  • Can't figure out how to use Amazon SES as a smart host for Exchange Online

    Hi,
    I have a problem that is proving very difficult to solve, and I'm hoping someone on here might know a bit more about this.
    I am trying to configure MS Exchange Online to route all emails through Amazon SES as a relay server, however the problem is that SES seems to want you to pass it SMTP username and password credentials to authenticate with, and I don't think Exchange Online
    allows for this?
    I have checked all the options in Outbound Connector section and there doesn't seem to be any place where I can choose SMTP authentication.  On Exchange 2013 and on-premise 365 Exchange solution I believe you can do this, but with pure Exchange Online
    I'm not sure...
    Does anyone know whether this is possible, and if not why Microsoft doesn't allow it / if they might be intending to enable this in the near future?
    Thanks a lot in advance!
    Tom

    Hi,
    Since your questions are Exchange Online related, I suggest we also ask it on the Microsoft Exchange Online forum:
    https://social.technet.microsoft.com/Forums/msonline/en-US/home?forum=onlineservicesexchange
    Hope you can get your answer soon.
    Thanks,
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Simon Wu
    TechNet Community Support

Maybe you are looking for

  • I want to use imessage on my pc

    Hi, I no longer have my iphone, but still have my ipad mini. I want to use imessage on my pc, Can i do this!, and if so, how do i do it?... Thanx in advance for any and all replies that may come...

  • Volume control when using Apple TV for playing video

    Hi, I'm using a pair of active speakers with no built in volume control with my Apple TV. When using the ATV for streaming audio (for example Spotify) I can control the volume with the iOS device I'm using as the source, but not while streaming video

  • Volume button not working in Remote

    When using the Remote application, the volume button on the side of the Touch doesn't work. The on-screen volume slider does work but I'd like to be able to use other applications and use the volume button rather than having to go in and use the slid

  • How to Import NAS Library into iTunes...

    Well the problem is my dad gave me a little job to get the music from the nas into the itunes libary. i already got that part done but now he wants that he can drag the music whats inside the NAS folder into an ipod/iphone. i was look around on googl

  • IPhone 3 sync issues

    My iPhone 3 never completes the sync with the computer. It gets to Step 6 of 6 and says "Waiting for changes to be applied". It never finishes. I unplug the phone and then I have to power off my phone to get the little sync arrows to go away. It has