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

Basic development question for Exchange Server App

$
0
0

Dear All,

       I have to develop software for exchange server backup/restore (edb, stm, chk, and log). I have good experience in software development. But, new to Exchange Server 2003/2007/2010/2013 development.

       I would like to choose C++ programming language for development. Is it right?

       Please suggest good book/sample code for development.

       Thanks in advance.

Best Regards,

Al Ain.


Thanks in advance, Best Regards, Al Ain.


Email SearchFilter on EmailMessageSchema.DisplayFrom

$
0
0

hello,

I'm trying to include the From display name of an email in my search result when performing EWS search.  from the

EmialMessageSchema has a property for DispalyTo and DisplayCC but I don't see DisplayFrom, does any one know why?

and How I will be able to achieve search in email's from DispalyName?  I don't see a property DisplayBB.

 

thanks

 

Nebiyu.

EWS : Appointments : Is there any way to avoid copying the extended properties when copying appointments in the calendar (using ctrl + v) ?

$
0
0
Hello there ... 
I am using the extended properties to store a GUID which is used to identify appointments, since item.ID is changable with changing the folder. 

My problem happens when copying the appointment using the keyboard and when inviting people for a meeting (which I believe all it does is also copying the original calendar item (appointment) from the meeting organizer) it copies also the extended properties (including the guid) . 

So is there any suggestion how to solve this problem ? is there any way to copy items without copying their extended properties? 

Ahmad

EWS Java API autodiscover on a subdomain

$
0
0
I'm using the EWS Java API to hit our Exchange server. I would like to use autodiscover, but the autodiscover service is on a subdomain (mail.mycompany.com instead of mycompany.com), and our email addresses are on the domain (user@mycompany.com). Is there a way, short of changing the source to accept that host, to tell the ExchangeService object to look for the autodiscover service on the subdomain, rather than assume it's on the exact same domain as the email address?

The Autodiscover service couldn't be located with EWS Java API 1.1

$
0
0
i am using EWS Java API 1.1 to access exchange 2010 account as follows:
                        ExchangeService service = new ExchangeService();    			ExchangeCredentials credentials = new WebCredentials(email,    					password);    			service.setCredentials(credentials);    			service.autodiscoverUrl("adamb@fabrikam.com");    			Folder inbox = Folder.bind(service, WellKnownFolderName.Inbox);    			System.out.println("messages: " + inbox.getTotalCount());



but i am getting the following exception:
    08/10/2012 05:11:35 م org.apache.commons.httpclient.HttpMethodDirector executeWithRetry    INFO: I/O exception (java.net.ConnectException) caught when processing request: Connection timed out: connect    08/10/2012 05:11:35 م org.apache.commons.httpclient.HttpMethodDirector executeWithRetry    INFO: Retrying request    08/10/2012 05:11:56 م org.apache.commons.httpclient.HttpMethodDirector executeWithRetry    INFO: I/O exception (java.net.ConnectException) caught when processing request: Connection timed out: connect    08/10/2012 05:11:56 م org.apache.commons.httpclient.HttpMethodDirector executeWithRetry    INFO: Retrying request    08/10/2012 05:12:17 م org.apache.commons.httpclient.HttpMethodDirector executeWithRetry    INFO: I/O exception (java.net.ConnectException) caught when processing request: Connection timed out: connect    08/10/2012 05:12:17 م org.apache.commons.httpclient.HttpMethodDirector executeWithRetry    INFO: Retrying request    microsoft.exchange.webservices.data.AutodiscoverLocalException: The Autodiscover service couldn't be located.    	at microsoft.exchange.webservices.data.AutodiscoverService.internalGetLegacyUserSettings(Unknown Source)    	at microsoft.exchange.webservices.data.AutodiscoverService.getLegacyUserSettings(Unknown Source)    	at microsoft.exchange.webservices.data.AutodiscoverService.internalGetLegacyUserSettings(Unknown Source)    	at microsoft.exchange.webservices.data.AutodiscoverService.getUserSettings(Unknown Source)    	at microsoft.exchange.webservices.data.ExchangeService.getAutodiscoverUrl(Unknown Source)    	at microsoft.exchange.webservices.data.ExchangeService.autodiscoverUrl(Unknown Source)    	at microsoft.exchange.webservices.data.ExchangeService.autodiscoverUrl(Unknown Source)    	at main.java.TestMail.main(TestMail.java:22)



please advise how to fix that.

Make room reservation without impersonation

$
0
0

I feel like I no longer see the wood for the trees. What I'm trying to achieve in the end is the following scenario:

We have a custom application which should be used to reserve rooms in Outlook. I got a exchange account which should be used for this and which should be the only one to make reservations for the available rooms. The used account should have the permission to make a fixed reservation for the room, but I don't know how to add an appointment to the room exchange account via code.

Is impersonation the only way to achieve what I'm looking for? Beside that option I've only found ways to read other persons folder. Any help is much appreciated and any kind of c# code would almost make me try ;)

[EWS1.2][Exchange2010] Update of a specific response message fails

$
0
0

Hello guys,

I use the following piece of code in order to create and send a reply message. The reply message has the Subject and Body updated.

 PropertySet tmpitemv3 = new PropertySet(BasePropertySet.IdOnly);
          tmpitemv3.Add(EmailMessageSchema.BccRecipients);
          tmpitemv3.Add(EmailMessageSchema.Body);
          tmpitemv3.RequestedBodyType = BodyType.Text;
          tmpitemv3.Add(EmailMessageSchema.CcRecipients);
          tmpitemv3.Add(EmailMessageSchema.DateTimeReceived);
          tmpitemv3.Add(EmailMessageSchema.From);
          tmpitemv3.Add(EmailMessageSchema.HasAttachments);
         tmpitemv3.Add(EmailMessageSchema.Subject);
          tmpitemv3.Add(EmailMessageSchema.ParentFolderId);
          tmpitemv3.Add(EmailMessageSchema.ToRecipients);
         
          EmailMessage tmpitem = EmailMessage.Bind(_ExchangeService, new ItemId(emailId), tmpitemv3);
          
ResponseMessage responseMessage =    tmpitem.CreateReply(replyToAll);
          responseMessage.Subject = MailSubject;
          responseMessage.Body = new MessageBody(BodyType.Text, MailBody);
         
     responseMessage.SendAndSaveCopy();

The problem appears when i try to insert a new Body in a specific email message. The message is a conversation with a lot of replies with many of them to be from different mobile clients(iPhone,WP,Adndroid).

If i insert the value "1" as string (MailBody = "1"/MailSubject="1") in the Body and Subject and the "SendAndSaveCopy()" runs, the reply message will arrive in Outlook but its body instead of "1" it contains the body of the original message. Also, the Sent: value is not encoded correctly.

The red "Empty Body" was added to the picture by me to display that the body does not have a value.


No exception is returned.
It seems that there is something wrong with the body of the original message, an invalid char for example, but i could not locate it. Probably something fails on the server and returns the old body without the reply text.


1)EmailMessage.Bind()

EwsRequest

<Trace Tag="EwsRequest" Tid="12" Time="2012-10-11 13:25:21Z" Version="14.02.0051.000">
  <?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" />
      <t:TimeZoneContext>
        <t:TimeZoneDefinition Id="GTB Standard Time" />
      </t:TimeZoneContext>
    </soap:Header>
    <soap:Body>
      <m:GetItem>
        <m:ItemShape>
          <t:BaseShape>IdOnly</t:BaseShape>
          <t:BodyType>Text</t:BodyType>
          <t:AdditionalProperties>
            <t:FieldURI FieldURI="message:BccRecipients" />
            <t:FieldURI FieldURI="message:CcRecipients" />
            <t:FieldURI FieldURI="item:DateTimeReceived" />
            <t:FieldURI FieldURI="message:From" />
            <t:FieldURI FieldURI="item:HasAttachments" />
            <t:FieldURI FieldURI="item:Importance" />
            <t:FieldURI FieldURI="message:IsRead" />
            <t:FieldURI FieldURI="item:Size" />
            <t:FieldURI FieldURI="item:Subject" />
            <t:FieldURI FieldURI="item:ParentFolderId" />
            <t:FieldURI FieldURI="message:ToRecipients" />
            <t:FieldURI FieldURI="item:Body" />
            <t:ExtendedFieldURI PropertyTag="4224" PropertyType="Integer" />
            <t:ExtendedFieldURI PropertyTag="4225" PropertyType="Integer" />
            <t:ExtendedFieldURI PropertyTag="4226" PropertyType="SystemTime" />
          </t:AdditionalProperties>
        </m:ItemShape>
        <m:ItemIds>
          <t:ItemId Id="AAMkADMwMjUxYmFiLWFlMTUtNGEzMS04ODVmLTk3YTA1MmI4ZjQ0MQBGAAAAAADydAPT2CPrQ7mPmLhnFVs/BwAOnHJ31G54TJYzZEo7fdV2AAACIVDvAAC/XW/Glh3XS4Z3wJwSLHsvAAAD0UpOAAA=" />
        </m:ItemIds>
      </m:GetItem>
    </soap:Body>
  </soap:Envelope>
</Trace>



2) Response with the original email body in Text

EwsResponse

traceMessage:<Trace Tag="EwsResponse" Tid="12" Time="2012-10-11 13:25:23Z" Version="14.02.0051.000">
  <?xml version="1.0" encoding="utf-8"?>
  <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
    <s:Header>
      <h:ServerVersionInfo MajorVersion="14" MinorVersion="1" MajorBuildNumber="421" MinorBuildNumber="2" Version="Exchange2010_SP1" xmlns:h="http://schemas.microsoft.com/exchange/services/2006/types" xmlns="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
    </s:Header>
    <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <m:GetItemResponse xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
        <m:ResponseMessages>
          <m:GetItemResponseMessage ResponseClass="Success">
            <m:ResponseCode>NoError</m:ResponseCode>
            <m:Items>
              <t:Message>
                <t:ItemId Id="AAMkADMwMjUxYmFiLWFlMTUtNGEzMS04ODVmLTk3YTA1MmI4ZjQ0MQBGAAAAAADydAPT2CPrQ7mPmLhnFVs/BwAOnHJ31G54TJYzZEo7fdV2AAACIVDvAAC/XW/Glh3XS4Z3wJwSLHsvAAAD0UpOAAA=" ChangeKey="CQAAABYAAAC/XW/Glh3XS4Z3wJwSLHsvAAAD7sTW" />
                <t:ParentFolderId Id="AAMkADMwMjUxYmFiLWFlMTUtNGEzMS04ODVmLTk3YTA1MmI4ZjQ0MQAuAAAAAADydAPT2CPrQ7mPmLhnFVs/AQAOnHJ31G54TJYzZEo7fdV2AAACIVDvAAA=" ChangeKey="AQAAAA==" />
                <t:Subject>Re: assistance required</t:Subject>
                <t:Body BodyType="Text">Is this written in a guide anywhere, as I feel I wasted valuable time trying to get it sorted
It is not clear in the console, while save, save &amp; close publish and app stays are large buttons
Update Cancel is so small and seems to indicate
To cancel any update.

Thanks for feedback

Keith

Sent from my iPhone


</t:Body>
                <t:DateTimeReceived>2012-10-09T08:46:59Z</t:DateTimeReceived>
                <t:Size>482158</t:Size>
                <t:Importance>Normal</t:Importance>
                <t:HasAttachments>false</t:HasAttachments>
                <t:ExtendedProperty>
                  <t:ExtendedFieldURI PropertyTag="0x1080" PropertyType="Integer" />
                  <t:Value>261</t:Value>
                </t:ExtendedProperty>
                <t:ExtendedProperty>
                  <t:ExtendedFieldURI PropertyTag="0x1081" PropertyType="Integer" />
                  <t:Value>102</t:Value>
                </t:ExtendedProperty>
                <t:ExtendedProperty>
                  <t:ExtendedFieldURI PropertyTag="0x1082" PropertyType="SystemTime" />
                  <t:Value>2012-10-11T12:51:41Z</t:Value>
                </t:ExtendedProperty>
                <t:ToRecipients>
                  <t:Mailbox>
                    <t:Name>GZ</t:Name>
                    <t:EmailAddress></t:EmailAddress>
                    <t:RoutingType>SMTP</t:RoutingType>
                  </t:Mailbox>
                </t:ToRecipients>
                <t:CcRecipients>
                  <t:Mailbox>
                    <t:Name>NF</t:Name>
                    <t:RoutingType>SMTP</t:RoutingType>
                  </t:Mailbox>
                  <t:Mailbox>
                    <t:Name>NG</t:Name>
                    <t:RoutingType>SMTP</t:RoutingType>
                  </t:Mailbox>
                </t:CcRecipients>
                <t:From>
                  <t:Mailbox>
                    <t:Name>Keith Collyer</t:Name>
                    <t:RoutingType>SMTP</t:RoutingType>
                  </t:Mailbox>
                </t:From>
                <t:IsRead>true</t:IsRead>
              </t:Message>
            </m:Items>
          </m:GetItemResponseMessage>
        </m:ResponseMessages>
      </m:GetItemResponse>
    </s:Body>
  </s:Envelope>
</Trace>

3) Update Response Message, with Subject=1 and Body=1, and SendAndSaveCopy()

EwsRequest

<Trace Tag="EwsRequest" Tid="12" Time="2012-10-11 13:25:28Z" Version="14.02.0051.000">
  <?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" />
      <t:TimeZoneContext>
        <t:TimeZoneDefinition Id="GTB Standard Time" />
      </t:TimeZoneContext>
    </soap:Header>
    <soap:Body>
      <m:CreateItem MessageDisposition="SendAndSaveCopy">
        <m:SavedItemFolderId>
          <t:DistinguishedFolderId Id="sentitems" />
        </m:SavedItemFolderId>
        <m:Items>
          <t:ReplyToItem>
            <t:Subject>1</t:Subject>
            <t:Body BodyType="Text">1</t:Body>
            <t:ToRecipients>
              <t:Mailbox>
                <t:EmailAddress>nfountas@globoplc.com</t:EmailAddress>
              </t:Mailbox>
            </t:ToRecipients>
            <t:CcRecipients />
            <t:BccRecipients />
            <t:ReferenceItemId Id="AAMkADMwMjUxYmFiLWFlMTUtNGEzMS04ODVmLTk3YTA1MmI4ZjQ0MQBGAAAAAADydAPT2CPrQ7mPmLhnFVs/BwAOnHJ31G54TJYzZEo7fdV2AAACIVDvAAC/XW/Glh3XS4Z3wJwSLHsvAAAD0UpOAAA=" ChangeKey="CQAAABYAAAC/XW/Glh3XS4Z3wJwSLHsvAAAD7sTW" />
          </t:ReplyToItem>
        </m:Items>
      </m:CreateItem>
    </soap:Body>
  </soap:Envelope>
</Trace>

ResponseOK, to each of the above functions.

At last when i get the reply message from the Inbox folder, the Body property is not "1".

EwsResponse <Trace Tag="EwsResponse" Tid="12" Time="2012-10-11 13:48:17Z" Version="14.02.0051.000"> <?xml version="1.0" encoding="utf-8"?> <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> <s:Header> <h:ServerVersionInfo MajorVersion="14" MinorVersion="1" MajorBuildNumber="421" MinorBuildNumber="2" Version="Exchange2010_SP1" xmlns:h="http://schemas.microsoft.com/exchange/services/2006/types" xmlns="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" /> </s:Header> <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <m:GetItemResponse xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types"> <m:ResponseMessages> <m:GetItemResponseMessage ResponseClass="Success"> <m:ResponseCode>NoError</m:ResponseCode> <m:Items> <t:Message> <t:ItemId Id="AAMkADMwMjUxYmFiLWFlMTUtNGEzMS04ODVmLTk3YTA1MmI4ZjQ0MQBGAAAAAADydAPT2CPrQ7mPmLhnFVs/BwAOnHJ31G54TJYzZEo7fdV2AAACIVDvAAC/XW/Glh3XS4Z3wJwSLHsvAAAD7kgxAAA=" ChangeKey="CQAAABYAAAC/XW/Glh3XS4Z3wJwSLHsvAAAD7sZv" /> <t:ParentFolderId Id="AAMkADMwMjUxYmFiLWFlMTUtNGEzMS04ODVmLTk3YTA1MmI4ZjQ0MQAuAAAAAADydAPT2CPrQ7mPmLhnFVs/AQAOnHJ31G54TJYzZEo7fdV2AAACIVDvAAA=" ChangeKey="AQAAAA==" /> <t:ItemClass>IPM.Note</t:ItemClass> <t:Subject>1</t:Subject> <t:Sensitivity>Normal</t:Sensitivity> <t:Body BodyType="Text"> ________________________________ From: Keith

Sent: ?????, 9 ????????? 2012 11:46:58 ?? To: GZ Cc: NF; NG Subject: Re: assistance required Is this written in a guide anywhere, as I feel I wasted valuable time trying to get it sorted It is not clear in the console, while save, save &amp; close publish and app stays are large buttons Update Cancel is so small and seems to indicate To cancel any update. Thanks for feedback Keith Sent from my iPhone


I am stuck. What can be going wrong?

I am willing to send the original email if i am asked.

Any help?

Thank you.





[E2013][EWS - AutoGen][JAVA][Outlook Contacts vs Personas]

$
0
0

How to get ONLY user's outlook contacts using EWS API for exchange 2013? ( and NOT any other persona/unified contacts/auto generated/aggregated contacts)

Contacts are managed in different folders internally, but then how to query specific contacts folder when using EWS API ? (Note: We cannot use display name of folders).


How to handle the situation when meeting is extended, if number of meetings are adjacent and if one user extends a meeting, how should we extend other adjacent meeting automatically.

$
0
0

How to handle the situation when meeting is extended, if number of meetings are adjacent and if one user extends a meeting, how should we extend other adjacent meeting automatically.

How to get Outlook 2003 calendar color through EWS

$
0
0

We are now using Exchange 2010 SP1. Most of the users are using Outlook 2007/2010 but we still have several users using Outlook 2003 because the upgrade will cost a lot. Everything is working well. 

My manager asked me to generate a report including all the calendar info of all the users. I need to get the color (category/label) of the appointment items of each user programmatically through EWS. 

I have successfully developed the VB.NET code to access Master Category to get appointment color via EWS. The problem is the same method does not work on appointments defined by Outlook 2003. For example:

If a user uses Outlook 2007/2010 and he creates an appointment with 'Red Category', I can get this appointment and get its color (red). The color will be the same in OWA (webmail) either.

But if a user uses Outlook 2003 and he creates an appointment with 'Red label', I cannot get the color of this appointment via EWS through the same method.  The color will be synchronized to OWA so I believe there must be some way to get the color. 

I also find in Outlook 2007/2010, the color of the appointment is defined as'Category List' but in Outlook 2003 the color is defined as 'Labels' but not the 'Category List'. The 'Category' in Outlook 2003 is NOT color but groups for calendar. 

Anyone can help?

Thanks VERY MUCH. 


Regards

EWS save contact or task email attachment to file

$
0
0

I'm able to read an email and get its item attachments (not file attachments) and want to save them to a file.  I'm trying to get the MimeContent for tasks and contacts attached to an email.  But, when I do, I get the following error:

MIME conversion is not supported for this item type

itemAttachment = attachment as ItemAttachment;
itemAttachment.Load(new PropertySet(ItemSchema.MimeContent));

I can recast the itemAttachment to a EWS Task or Contact object, and everything seems to be there.  How can I programatically create an EML file out of attached Tasks or Contacts?  The mimeContent approach seems to work for everything else....


 

Exchange 2003 | Event sink | ISMTPOnArrival

$
0
0

Hello,
I come to you because I think I'm a little confused.
My company uses Exchange 2003. I need a way to edit all the emails that are sent from my compagny.

I saw that he had probably used the event sink and subscribe me ISMTPOnArrival.
Is this really?

I'd do it in C #.
Is it possible?

How to install DLL final I have created?

Thank you and sorry for my english.

Exchange 2007 Message Delivery Restrictions

$
0
0

I have a message delivery restriction set on a distribution group to only accept messages from a user or distribution group. However, it does not block replies. Is this possible to block the reply even after the user or group has received the initial message?

thanks

Certificate Wizard - outlook web app on the intranet

$
0
0

I am installing Exchange 2010 SP1 in an existing Exchange 2007 environment. I have installed the CAS role on a server and am going through the list for cas configuration - cas array, dns entries, etc. At the current time users access OWA via the host name internally and an external_ip_address/owa externally. Existing certificate has the ip address as the name which generates an error internally. I want all users to use mail.domain.com for OWA internally or externally. I set a dns entry on my internal DNS server for mail.domain.com to point to the new Exchange server ip address and, on my ISP DNS server to an external but different IP address than OWA is currently using. I am running through the certificate wizard and figured I needed one certificate that includes mail.domain.com, autodiscover.domain.com, and hostname_of_the_new_server.domain.com but the wizard added hostname_of_the_old_server.domain.com to the list in the internal OWA section. Questions - (1) do I need to add CAS-Array.domain.com to the certificate and (2) why did the wizard add the old servers hostname to the list of OWA internal hostnames?

Thx

Eric


eburch@lasertel.com

Exchange 2007 reply RPC Fault (0x00000721)

$
0
0

One of our customers is having issue where Exchange Server use to reply RPC Fault (0x00000721) on RPC Request sent by Outlook.

They use Exchange 2007. Encryption is turned on for email accounts.

Customer have provided network traffic captured during the incident. Since traffic is encrypted we cannot tell what type of ROPs outlook sends to the server, but from RPC message sizes it looks like user is uploading data to the server (Outlook sends 32KB RPC messages). Initially Server accepts RPC requests and reply RPC response where after next data chunk is sent by Outlook. At one point Exchange reply RPC fault (0x00000721) where after Outlook closes connection and opens new one. From RPC message flow pattern it looks like Outlook re-try the same operation which failed in previous connection and it fails again. Therefore Outlook gets into the loop where it tries to complete operation with no success because of failure.

http://msdn.microsoft.com/en-us/library/windows/desktop/ms681386%28v=vs.85%29.aspx
RPC_S_SEC_PKG_ERROR
    1825 (0x721)
    A security package specific error occurred.


We don't know what operations triggered by end users on Outlook that ends with described traffic.

What could be possible scenarios when Exchange Server fail with RPC Fault error code 0x00000721?
How could we troubleshoot it?


Janis


[EWS] Setting Organizer for calendar entry

$
0
0

I've got an application that adds calendar entries via EWS using direct XML, not the API.  I am trying to add an event to a user calendar, where the user is an attendee, but not the organizer.  If I try to set the <t:Organizer> property, I get the error response "Set action is invalid for property".  I can set the attendees, but the organizer always comes out to be the person who's calendar I am updating - which is inaccurate.  I might understand this if the organizer was some random name/address, but in this case, I am setting the name and email to be that of an existing Office 365 user in the same domain.  Any ideas?

Here is a xml snippet showing my code:

...
<t:Organizer>
<t:Mailbox>
<t:Name>
Jamie Thorogood
</t:Name>
<t:EmailAddress>
css02jt@gold.ac.uk
</t:EmailAddress>
</t:Mailbox>
</t:Organizer>
</t:CalendarItem>
</Items>

 

Jeffrey McKay

Cannot send email with EWS Java API

$
0
0
i am using EWS to send emails on Exchange 2010
as follows:

           
ExchangeService service = new ExchangeService();    		ExchangeCredentials credentials = new WebCredentials(email, password);    		service.setCredentials(credentials);    		service.setUrl(new java.net.URI("https://" + host    				+ "/EWS/Exchange.asmx"));    		service.setTraceEnabled(true);                EmailMessage msg = new EmailMessage(service);    		msg.setSubject("Hello world!");    		msg.setBody(MessageBody    				.getMessageBodyFromText("Sent using the EWS Managed API."));    		msg.getToRecipients().add("email");    		msg.send();



the message is not delivered to the inbox, and i don't know what is the problem.
after i enabled tracing, i get the following :


 
   <Trace Tag="EwsRequestHttpHeaders" Tid="1" Time="2012-10-14 11:13:46Z">    POST /EWS/Exchange.asmx HTTP/1.1    Content-type : text/xml; charset=utf-8    Accept-Encoding : gzip,deflate    Keep-Alive : 300    User-Agent : ExchangeServicesClient/0.0.0.0    Connection : Keep-Alive    Accept : text/xml            </Trace>        <Trace Tag="EwsRequest" Tid="1" Time="2012-10-14 11:13:47Z">    <?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/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"><soap:Header><t:RequestServerVersion Version="Exchange2010_SP1"></t:RequestServerVersion></soap:Header><soap:Body><m:CreateItem MessageDisposition="SendOnly"><m:Items><t:Message><t:Subject>Hello world!</t:Subject><t:Body BodyType="HTML">Sent using the EWS Managed API.</t:Body><t:ToRecipients><t:Mailbox><t:EmailAddress>adamb@fabrikam.com</t:EmailAddress></t:Mailbox></t:ToRecipients></t:Message></m:Items></m:CreateItem></soap:Body></soap:Envelope>    </Trace>        14/10/2012 01:13:48 م org.apache.commons.httpclient.auth.AuthChallengeProcessor selectAuthScheme    INFO: NTLM authentication scheme selected    <Trace Tag="EwsResponseHttpHeaders" Tid="1" Time="2012-10-14 11:13:48Z">    200 text/xml; charset=utf-8    X-AspNet-Version : 2.0.50727    X-EwsPerformanceData : RpcC=3;RpcL=15;LdapC=0;LdapL=0;    Persistent-Auth : true    Date : Sun, 14 Oct 2012 11:13:48 GMT    Vary : Accept-Encoding    Transfer-Encoding : chunked    Content-Encoding : gzip    Content-Type : text/xml; charset=utf-8    X-Powered-By : ASP.NET    Server : Microsoft-IIS/7.5    Cache-Control : private            </Trace>        <Trace Tag="EwsResponse" Tid="1" Time="2012-10-14 11:13:48Z">    <?xml version="1.0" encoding="utf-8"?><s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Header><h:ServerVersionInfo MajorVersion="14" MinorVersion="1" MajorBuildNumber="218" MinorBuildNumber="14" Version="Exchange2010_SP1" xmlns:h="http://schemas.microsoft.com/exchange/services/2006/types" xmlns="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"/></s:Header><s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><m:CreateItemResponse xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types"><m:ResponseMessages><m:CreateItemResponseMessage ResponseClass="Success"><m:ResponseCode>NoError</m:ResponseCode><m:Items/></m:CreateItemResponseMessage></m:ResponseMessages></m:CreateItemResponse></s:Body></s:Envelope>    </Trace>



please advise how to solve this issue.

E2010 Using EMS from VB.Net results in Value cannot be null.Parameter name: parameters error

$
0
0

I am attempting to remove (and enable) mailusers on a networked 2010 Exchange server.  I am running the programs from a Win7 PC and have tried turning off Windows Firewall and UAC.  ExecutionPolicy is set to RemoteSigned.  I am also using an admin account that is specified as a Organization Management Account for E2010.

When invoking either of the following commands from a VB.Net program:

Remove-MailUser -identity xxxxxxxx@cccccccc.mmmm.tttt -domaincontroller WRXXXDC2.cccccccc.mmmm.tttt -WhatIf:$false -Confirm:$false

Remove-MailUser -identity xxxxxxxx@cccccccc.mmmm.tttt -domaincontroller WRXXXDC2.cccccccc.mmmm.tttt

I receive the following error:  Value cannot be null. Parameter name: parameters

This is also true when attempting the Enable-MailUser command.  The programs previously worked on an XP PC in an Exchange 2007 environment.

I am out of ideas on this issue.  The comamnds do work from a EMS prompt.  I don't specify credentials in my code but I am not making a remote connection. 

The logic to make the calls is as follows:

REM DEFINE OBJECTS/VARIABLES

Dim ps As PowerShell = PowerShell.Create
Dim ex As PSSnapInException = Nothing
ps.Runspace.RunspaceConfiguration.AddPSSnapIn("Microsoft.Exchange.Management.PowerShell.E2010", ex)
If Not ex Is Nothing Then
     adMsg = "Warning encountered loading Exchange PowerShell SnapIn: " & ex.InnerException.ToString
     swl.WriteLine(adMsg)
     Throw New System.Exception(adMsg)
 End If

REM CALL POWERSHELL TO REMOVE THE STUDENT MAILUSER EMAIL ACCOUNT AND AD ACCOUNT

ps.Streams.ClearStreams()
ps.Commands.Clear()
ps.AddScript("Remove-MailUser -identity " & upn & " -domaincontroller " & dnsHostFQDName & " -WhatIf:$false -Confirm:$false")

Dim commandResults As Collection(Of PSObject) = Nothing
commandResults = ps.Invoke()

REM Check for pipeline errors
Dim pipeErrors = ps.Streams.Error()
If pipeErrors.Count > 0 Then
    Throw New System.Exception(pipeErrors(0).ToString)
End If



How to delete attendee's appointment from calendar?

$
0
0

Hi All,

I need to totally delete meeting from organizer and attendee's calendars with EWS Managed API 1.2. What I do now:

var exApp = Microsoft.Exchange.WebServices.Data.Appointment.Bind(service, organizer.Id);
if(exApp.IsMeeting)
{
   exApp.Delete(Microsoft.Exchange.WebServices.Data.DeleteMode.HardDelete, Microsoft.Exchange.WebServices.Data.SendCancellationsMode.SendToNone);                        
                        for (int i = 0; i < x.RequiredAttendees.Count; ++i)
                        {
                            var reqApp = GetAttendeeAppointment(x, x.RequiredAttendees[i].Address);
                            try
                            {
                                reqApp.Delete(Microsoft.Exchange.WebServices.Data.DeleteMode.HardDelete);
                            }
                            catch (Exception ex)
                            {
                                _logger.LogError(ex.Message);                             
                            }
                        }
}

And it deletes both items: from organizer and attendee mailboxes, BUT after a while (or after press check messages button) attendee gets message in his Inbox folder with meeting invitation from organizer and item created in calendar again! Why exchange behavior is so strange? I have deleted items first from organizer calendar and then from attendee's, but meeting invitation has been sent by Exchange after while. What I do wrong? How to correctly and totally delete meeting from calendar folder of organizer and attendees? If you could, please post some code.

Thanx in advance


[EWS JAVA 1.1] CalendarFolder bind throws nullpointerexception

$
0
0

ExchangeService exchange object is setup ok, but on calendarFolder bind I get nullpointexception

CalendarFolder calFolder= CalendarFolder.bind(exchange, WellKnownFolderName.Calendar)

Any suggestions ?

Viewing all 7132 articles
Browse latest View live




Latest Images