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

EWS Managed API, Why Item.DateTimeSent.Millisecond is always zero?

$
0
0

I am trying to calculate the time taken to send email message and time taken to receive email message. i am using EWS in my program , I set streaming notification to receive call back when a new mail reaches reciptent mailbox .

once received notification i bind the Itemevent with ews service , i checked the item properties DateTimeCreated, DateTimeSent, DateTimeReceived.All these properties are of DateTime object.

I checked DateTimeSent milisecond is always 0, whereas DateTimeCreated, DateTimeReceived has millisecond value.

I couldnot figure out why DateTimeSent millisecond is always 0 everytime. if i want to claulate time taken from send to receive what should i do.

DateTimeReceived - Datetimesent is the actual time taken to send and receive the message?

or what is the correct way to calculate time taken to send and receive the message?

https://stackoverflow.com/questions/53606184/ews-managed-api-why-item-datetimesent-millisecond-is-always-zero


EWS Managed API, Why Item.DateTimeSent.Millisecond is always zero?

$
0
0

I am trying to calculate the time taken to send email message and time taken to receive email message. i am using EWS in my program , I set streaming notification to receive call back when a new mail reaches reciptent mailbox .

once received notification i bind the Itemevent with ews service , i checked the item properties DateTimeCreated, DateTimeSent, DateTimeReceived.All these properties are of DateTime object.

I checked DateTimeSent milisecond is always 0, whereas DateTimeCreated, DateTimeReceived has millisecond value.

I couldnot figure out why DateTimeSent millisecond is always 0 everytime. if i want to claulate time taken from send to receive what should i do.

DateTimeReceived - Datetimesent is the actual time taken to send and receive the message?

or what is the correct way to calculate time taken to  send and receive the message?

Regards,

kishore

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.

[E2007SP1][EWSMA][C#] CalendarFolder.FindAppointments - Recurrence has no occurrences in the specified range.

$
0
0

Hello All.  I'm trying to retrieve all of the calendar items for a particular user and date range.  Here is a small code snippet:

        ExchangeService exchangeServiceObject = new ExchangeService(ExchangeVersion.Exchange2007_SP1);//Set the url for the service
        exchangeServiceObject.Url = new Uri(webServicePath);//Set the credentials for the service
        exchangeServiceObject.Credentials = new WebCredentials(userName, password, domain);//Try to bind to the logged on user's calendar folder (Users with mailboxes on Exchange 2003 will fail with ServiceXmlDeserializationException)
        CalendarFolder myCalendar = CalendarFolder.Bind(exchangeServiceObject, WellKnownFolderName.Calendar);//If the calendar is valid, query it using the supplied dates - Expanding all recurrences by using CalendarView if (myCalendar != null)
        {
          CalendarView calendarView = new CalendarView(startDate, endDate);
          FindItemsResults<Appointment> myAppointments = myCalendar.FindAppointments(calendarView);

This code seems to work for 99% percent of the users.  I have 1 user (so far) that receives the following error on the myCalendar.FindAppointments call:

"Recurrence has no occurrences in the specified range"

Does anyone have any idea why he's receiving this error?  We have tried several different date ranges, but it appears as though he receives this error regardless of the date range specified.

Thanks.

Private flag not changed on room reservation after change on Organizer's calendar

$
0
0

Please advise if this is not the best forum since my scenario is on Office365.

If I create a new private meeting, and add a room location that is defined as a resource, the meeting on the room's calendar correctly reflects the private flag.

However, if I then edit the organizer's calendar and clear the private flag, the room's calendar does not appear to be updated with this change.  

I am querying the room's calendar via Graph API and the Sensitivity value remains Private.

We have set up the CalendarProcessing settings for the room for RemovePrivateProperty == false as required to allow the room to be marked as private if the incoming meeting request is private.  

Our workaround is to do 2 queries, first for the room, then a 2nd to get the organizer's meeting, but I'm trying to confirm that the background update to the rooms calendar skips over these fields.

Thanks in advance.


UPDATE: I can confirm that if the meeting begins as non-private, but then is marked as private, the room event DOES reflect this change.  So it appears to only be the scenario where the private flag is cleared.

Office 365 Mailbox programatic access fails: The Autodiscover service couldn't be located.

$
0
0

Not sure if this is the correct place but here goes:

I have been given a mailbox and I have written a windows service to look into the mailbox and process email messages.

The mailbox is of the form: createlead@api.mydomain.com

I log in to office365 with this email address and the password and I can see the mailbox just fine.

I try to connect with code:

ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2010_SP1);

Service.Credentials = new WebCredentials(username, password); //username as quoted above.

I get the following error:

Microsoft.Exchange.WebServices.Data.AutodiscoverLocalException: The Autodiscover service couldn't be located.
   at Microsoft.Exchange.WebServices.Autodiscover.AutodiscoverService.InternalGetLegacyUserSettings[TSettings](String emailAddress, List`1 redirectionEmailAddresses, Int32& currentHop)
   at Microsoft.Exchange.WebServices.Autodiscover.AutodiscoverService.GetLegacyUserSettings[TSettings](String emailAddress)
   at Microsoft.Exchange.WebServices.Autodiscover.AutodiscoverService.InternalGetLegacyUserSettings(String emailAddress, List`1 requestedSettings)
   at Microsoft.Exchange.WebServices.Autodiscover.AutodiscoverService.GetUserSettings(String userSmtpAddress, UserSettingName[] userSettingNames)
   at Microsoft.Exchange.WebServices.Data.ExchangeService.GetAutodiscoverUrl(String emailAddress, ExchangeVersion requestedServerVersion, AutodiscoverRedirectionUrlValidationCallback validateRedirectionUrlCallback)
   at Microsoft.Exchange.WebServices.Data.ExchangeService.AutodiscoverUrl(String emailAddress, AutodiscoverRedirectionUrlValidationCallback validateRedirectionUrlCallback)
   at LeadProcessor.Library.MailboxHelper.GetBinding(String Username, String Password) in C:\...\LeadProcessor\LeadProcessor.Library\MailboxHelper.cs:line 472
   at LeadProcessor.Library.MailboxHelper.GetEmailHelper(String Username, String Password) in C:\...\LeadProcessor\LeadProcessor.Library\MailboxHelper.cs:line 491
   at LeadProcessor.WindowsService.Service1.ProcessMailbox(Organisation Config)

I have tried the Remote Connectivity Analyser but can't work out which option I should be choosing (Office 365 General Tests? Single Sign On?)

Tried this and got error: The domain  isn't a federated domain.

Not sure if this is saying I am using the wrong option in the Remote Connectivity Analyser or if there is something wrong with the mailbox.

Can anyone help?

How to send an attachement with EWS and powershell in memory

$
0
0

I'd like to send automatic emails with attachements with powershell and in memory, so I do not want to persit to hdd.

 SO any hints - did search but found nothing.

That's my code without attachment:

$attachment = 'Some text for my text attachment!'

Import-Module -Name 'C:\Program Files\Microsoft\Exchange\Web Services\2.2\Microsoft.Exchange.WebServices.dll'
$exchVersion = new-object Microsoft.Exchange.WebServices.Data.ExchangeVersion 
$exchService = New-Object -TypeName Microsoft.Exchange.WebServices.Data.ExchangeService -ArgumentList $exchVersion
$exchService.AutodiscoverUrl($sender , {$true})
$eMail = New-Object -TypeName Microsoft.Exchange.WebServices.Data.EmailMessage -ArgumentList $exchService
$eMail.Subject = $Subject
$eMail.Body = $Body
$eMail.ToRecipients.Add($Recipient) | Out-Null
$eMail.SendAndSaveCopy()

thanks in advance!



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>



OST to PST Software Coding

$
0
0

Hello Everyone,

I am currently looking at writing some software that would allow users to be able to create a PST from an OST, I am new to coding and would look to distribute this application for free with no limitations.

I know the task can be done but the software always has limits, however as admins we always need it in the event of a failure hence the above track. If anyone can point me in the right direction for information as what I have found online is fairly useless.

Thank you in advance


MCP, MCTS, MCITP, MCITPVA, MCSA 2012, MCSE Private Cloud, MCSE Server Infrastructure

Outlook Custom Authentication Module

$
0
0

Hi,

We are trying to write a module (HttpModule) that will intercept the requests sends to the Exchange server over rpc-http or mapi-http. We put our module at the location Autodiscover, mapi, rpc in the Defualt Web Site. We do able to capture all the requests send to the Server. But what we want that only the request when the user authenticates with the user name and password in the Windows Security dialog, we process the request and ignore the rest. Especially in case of Mapi-Http we are continually getting request at the Module placed at the Default Web Site\mapi.

With Regards,

Ashish Pratap.

With Regards,

Ashish Pratap.

How to Merge pst file with exchange server using MAPI

$
0
0
hi,
    I have one pst file, i want  to merge all the mailboxes in PST file into exchange server using MAPI.
    I used PR_SEARCH_KEY to compare pst file mails with exchange server mails, so that we can copy messages which are not present in the exchange server mailbox. But  this approach fails to match search key, so not able to merge the mails.

   Is there any options available in MAPI to merge pst file with Exchange server mailboxes.
  
   Is PR_SEARCH_KEY unique in both pst mails and Exchange Server Mailbox mails?.
  
   If not , then any other unique key is available for every individual mails in Exchange Mailbox. Also tell information about merging with exchange server mailbox using any other approach.



  reply the answer as quick as possible,
  Thanks in advance.

 
   
   


getting UnAuthorized Error when trying to send email

$
0
0

I am getting UnAuthroized Error when trying to send email.

I am using Corporate Account.

ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2007_SP1);
            service.TraceEnabled = true;
            service.TraceFlags = TraceFlags.All;

            service.Credentials = new WebCredentials("XXXX@YYY.COM", "XXXXXXXX");
            service.AutodiscoverUrl("XXXXXX@YYYYY.com", RedirectionUrlValidationCallback);

 EmailMessage email = new EmailMessage(service);
            email.ToRecipients.Add("abc@yahoo.com");
            email.Subject = "Testing from C#";
            email.Body = new MessageBody("This is the first email I've sent by using the EWS Managed API");
            email.Send();

DKIM signature and body hash validation issue

$
0
0

I am working on a DKIM verification plugin (runs on EndOfData event) for Exchange Server (2010-2019), however Exchange keeps modifying the message header fields and certain elements of the message body which breaks the DKIM signature and body hash in the incoming emails. I have tested this on Exchange 2010-2019 servers (/w latest CUs & RUs) with various roles, but all version+role combination seem to do this. The strange thing, however, is that I could find find any KB or article on this.

Has anyone encountered this issue before? Is there a workaround or Exchange setting that I am not aware of?

Just a few examples:

- In case of multipart emails, the lines between the first boundary and the message header are removed.

- Certain header field values get wrapped with double-quotes.

- If there are more than 2 lines breaks between the header and body, they get reduced to 2.

EWS: Expaning Distribution List

$
0
0

Is it possible to expand more then one group at the same time using EWS protocol? Expanding each distribution list one by one is a time consuming process, and we need to send multiple request to the server. Is there any way to achieve this?

Example:

<?xml version=\"1.0\" encoding=\"utf-8\"?><soap:Envelope xmlns: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:RequestServerVersion Version=\"Exchange2007_SP1\" /></soap:Header>

<soap:Body>

<m:ExpandDL>

<m:Mailbox>

<t:ItemId Id=\"AAMkADY3NjYwNTQxLThjNTgtNDg1MC04MzkzLWYwZmMzMretertggdfgGAAAAAAB1hlnlkoV7Sry3kTJQWeAiBwC1hzLVVjVlRprk7A9prr34AAAAEOAAC1hzLVVjVlRprk7A9pJ5gGAADPnrewrAAA=\" ></t:ItemId>

<t:ItemId Id=\"AAMkADY3NjYwNTQxLThjNTgtNDg1MC04MzkzLWYwZmMzMjFlY2gfdsgdfsgAAAAAAB1hlnlkoV7Sry3kTJQWeAiBwC1hzLVVjVlRprk7A344fdAAAAEOAAC1hzLVVjVlRprk7A9pJ5gGAADPn9erwerAA=\"></t:ItemId>

</m:Mailbox>

</m:ExpandDL>

</soap:Body>

</soap:Envelope>

[EWS][Exchange-Online][EWSMA] Since some Office 365 update the SyncFolderItems(..) function gives me and many others "The operation failed., IdAndSession.MailboxSession: session is not IMailboxSession"

$
0
0

As mentioned here: stackoverflow.com/questions/48950767

there is a new problem with Office 365 public folders function SyncFolderItems.

It gives "The operation failed., IdAndSession.MailboxSession: session is not IMailboxSession" if you use the SyncFolderItems function.

here is some testcode:

ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2016);
service.Url = new Uri("https://outlook.office365.com/EWS/Exchange.asmx");
service.Credentials = new WebCredentials("albrecht@duerer.com", "pwd");
try
{
    Folder publicfolder = Folder.Bind(service, WellKnownFolderName.PublicFoldersRoot, BasePropertySet.FirstClassProperties);
    var res = publicfolder.FindFolders(new FolderView(100) {  });

    service.ClientRequestId = "@MS Team: Please fix this error!!";
    service.UserAgent  = "@MS Team: Please fix this error!!";

    // Next line, the exception will come up.
    var changes = service.SyncFolderItems(WellKnownFolderName.PublicFoldersRoot, BasePropertySet.IdOnly, null, 10, SyncFolderItemsScope.NormalItems, "");
}
catch (Exception ex)
{
    Console.WriteLine(ex);
}



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. 

Exchange server 2016 (On-premise) and EWS Managed API

$
0
0

Hi ,

We are looking for a feasibility for Integration of cloud based HR application with Exchange server 2016 on-premise environment to be able to access Free-busy information from on-prem mailbox calandars.

Kindly let us know if

1. Rest API can be considered for the same. Kindly shared relevant documentation for step-step changes required on On-prem Exch Environment.

2. Managed EWS API can be considered.Kindly shared relevant documentation for step-step changes required on On-prem Exch Environment.

Cheers!

Priya

Exchange Online - How to export psd file via PowerShell

$
0
0

Hello

We want to archive user data via PowerShell.
The following command doesn't work:

New-MailboxExportRequest  [-Name ] -Mailbox  -FilePath  [-IsArchive] [-SourceRootFolder ] [-TargetRootFolder ] [-IncludeFolders ,...] [-ExcludeFolders ,...] [-ContentFilter ] [-Priority ]

The following Message appears:
"PS C:\DEV\Office 365\powershell_scripts> New-MailboxExportRequest -Mailbox "prename.name@domain.com" -FilePath "C:\Users\Public\Desktop\"

New-MailboxExportRequest : Die Benennung "New-MailboxExportRequest" wurde nicht als Name eines Cmdlet, einer Funktion,
einer Skriptdatei oder eines ausführbaren Programms erkannt. Überprüfen Sie die Schreibweise des Namens, oder ob der
Pfad korrekt ist (sofern enthalten), und wiederholen Sie den Vorgang.
In Zeile:1 Zeichen:1
+ New-MailboxExportRequest -Mailbox "prename.name@domain.com" -FilePat ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (New-MailboxExportRequest:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException"

Can someone help us?

Kind regards

Can we read Attachment property in Transport Agent level

$
0
0

I am sending an attachment say Word document from Outlook to a receiver. In my TransportAgent is it possible to read the custom properties of the attachment? Right now I am able to read only the below properties, I want a property which was set by us as shown in the link https://support.office.com/en-us/article/view-or-change-the-properties-for-an-office-file-21d604c2-481e-4379-8e54-1dd4622c6b75

        public string ContentType { get; set; }
        public bool IsOleAttachment { get; }
        public AttachmentType AttachmentType { get; }
        public EmailMessage EmbeddedMessage { get; set; }
        public MimePart MimePart { get; }
        public string FileName { get; set; }
        public bool TryGetContentReadStream(out Stream result);

Import Multiple PST's into one mailbox

$
0
0

Hi,

I have multiple PST files with different names that I need to import into a single mailbox using Exchange 2010.

I think I've come up with a script but not sure if it'll work, could someone check for me please or suggest a better method?

Dir \\Server\PST_Files\*.pst | %{ New-MailboxImportRequest -Name BulkPSTImport -BatchName MassImport -Mailbox MYPSTImportMAILBOX}

Thanks

Viewing all 7132 articles
Browse latest View live


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