<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Rick@Work</title><link>http://blogs.msdn.com/rickhall/default.aspx</link><description>Random ideas, thoughts and solutions</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Exchange Server 2007 SP1, Outlook Web Access Customization: Part 3, NewHelpTicket.ASPX</title><link>http://blogs.msdn.com/rickhall/archive/2009/09/28/exchange-server-2007-sp1-outlook-web-access-customization-part-3-newhelpticket-aspx.aspx</link><pubDate>Mon, 28 Sep 2009 22:40:03 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9900421</guid><dc:creator>Rick_H</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/rickhall/comments/9900421.aspx</comments><wfw:commentRss>http://blogs.msdn.com/rickhall/commentrss.aspx?PostID=9900421</wfw:commentRss><description>&lt;p&gt;&lt;em&gt;I’ve seen a few cases come through where customer’s are trying to implement the customization features that were introduced with Exchange Server 2007 SP1.&amp;#160; There’s a few key areas that seem to cause trouble so I figured it would be worth walking through a simple scenario that covered many of the different aspects. (&lt;a href="http://blogs.msdn.com/rickhall/archive/2009/01/28/exchange-server-2007-sp1-outlook-web-access-customization-part-1-registry-xml.aspx"&gt;Link to Part 1 of the series&lt;/a&gt;, &lt;a href="http://blogs.msdn.com/rickhall/archive/2009/03/24/exchange-server-2007-sp1-outlook-web-access-customization-part-2-uiextensions-xml.aspx"&gt;Link to Part 2 of the series&lt;/a&gt;)&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;It’s been a long time coming, but I’m finally getting around to completing this series of posts.&amp;#160; I had originally intended to use the standard Visual Studio generated proxy classes for this sample, but with the introduction of the &lt;a href="http://msdn.microsoft.com/en-us/library/dd637749.aspx"&gt;EWS Managed API&lt;/a&gt; the code for this scenario becomes much easier to write.&amp;#160; The Managed API is currently &lt;a href="http://www.microsoft.com/downloads/details.aspx?displaylang=en&amp;amp;FamilyID=e8f38dd1-f123-4a16-b4c8-584d1f84af48"&gt;available as a Release Candidate&lt;/a&gt;.&amp;#160; After you install the API, you will have to copy the DLL file from the install location (&lt;strong&gt;&lt;em&gt;C:\Program Files\Microsoft\Exchange\Web Services\1.0&lt;/em&gt;&lt;/strong&gt;) to a location where it can be found by your ASP.Net code.&amp;#160; For this sample you can place it in: &lt;strong&gt;&lt;em&gt;C:\Program Files\Microsoft\Exchange Server\ClientAccess\Owa\bin&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Now down to business.&amp;#160; This form is basically a very simple ASP.NET form to use the EWS Managed API to send the email as the user.&amp;#160; For demonstration purposes, I have simply sent the resulting form back to the originating user using the “ea” value from the QueryString.&lt;/p&gt;  &lt;p&gt;Another interesting point is the code to impersonate the logged on user.&amp;#160; When implementing custom forms, you should be mindful of the identity that is being used.&amp;#160; In this example, the form is running in the same IIS Application Pool as OWA.&amp;#160; This means that it will have access to the session info.&amp;#160; I’ve used the identity of the logged on user available from the &lt;strong&gt;&lt;em&gt;Page &lt;/em&gt;&lt;/strong&gt;object and swapped the formatting of this value so that it can be used as a PrincipalName to impersonate the user.&amp;#160;&amp;#160; The reason that I used the identity from the Request instead of relying on the Primary SMTP address in the Querystring is that the client can alter the QueryString.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;em&gt;NewHelpTicket.ASPX:&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;(Note:&amp;#160; This sample code is intended only to show the concepts involved and is not production ready!&amp;#160; If you have questions, feel free to submit them via the comments or contact me through the “Email” link above.)&lt;/em&gt;&lt;/p&gt;  &lt;pre style="border-bottom-style: inset; border-right-style: inset; border-top-style: inset; border-left-style: inset" class="code"&gt;&lt;span style="background: #ffee62"&gt;&amp;lt;%&lt;/span&gt;&lt;span style="color: blue"&gt;@ &lt;/span&gt;&lt;span style="color: #a31515"&gt;Page &lt;/span&gt;&lt;span style="color: red"&gt;Language&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;C#&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;AutoEventWireup&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;true&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;EnableSessionState&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;True&amp;quot;&lt;/span&gt;&lt;span style="background: #ffee62"&gt;%&amp;gt;
&amp;lt;%&lt;/span&gt;&lt;span style="color: blue"&gt;@ &lt;/span&gt;&lt;span style="color: #a31515"&gt;Assembly &lt;/span&gt;&lt;span style="color: red"&gt;Name&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089&amp;quot; &lt;/span&gt;&lt;span style="background: #ffee62"&gt;%&amp;gt;
&amp;lt;%&lt;/span&gt;&lt;span style="color: blue"&gt;@ &lt;/span&gt;&lt;span style="color: #a31515"&gt;Import &lt;/span&gt;&lt;span style="color: red"&gt;Namespace&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;System.Xml&amp;quot; &lt;/span&gt;&lt;span style="background: #ffee62"&gt;%&amp;gt;
&amp;lt;%&lt;/span&gt;&lt;span style="color: blue"&gt;@ &lt;/span&gt;&lt;span style="color: #a31515"&gt;Import &lt;/span&gt;&lt;span style="color: red"&gt;Namespace&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;System.Net&amp;quot; &lt;/span&gt;&lt;span style="background: #ffee62"&gt;%&amp;gt;
&amp;lt;%&lt;/span&gt;&lt;span style="color: blue"&gt;@ &lt;/span&gt;&lt;span style="color: #a31515"&gt;Import &lt;/span&gt;&lt;span style="color: red"&gt;Namespace&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;System.Net.Security&amp;quot; &lt;/span&gt;&lt;span style="background: #ffee62"&gt;%&amp;gt;
&amp;lt;%&lt;/span&gt;&lt;span style="color: blue"&gt;@ &lt;/span&gt;&lt;span style="color: #a31515"&gt;Import &lt;/span&gt;&lt;span style="color: red"&gt;Namespace&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Microsoft.Exchange.WebServices.Data&amp;quot; &lt;/span&gt;&lt;span style="background: #ffee62"&gt;%&amp;gt;
&amp;lt;%&lt;/span&gt;&lt;span style="color: blue"&gt;@ &lt;/span&gt;&lt;span style="color: #a31515"&gt;Import &lt;/span&gt;&lt;span style="color: red"&gt;Namespace&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;System.Security.Cryptography.X509Certificates&amp;quot; &lt;/span&gt;&lt;span style="background: #ffee62"&gt;%&amp;gt;

&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;lt;!&lt;/span&gt;&lt;span style="color: #a31515"&gt;DOCTYPE &lt;/span&gt;&lt;span style="color: red"&gt;html PUBLIC &lt;/span&gt;&lt;span style="color: blue"&gt;&amp;quot;-//W3C//DTD XHTML 1.0 Transitional//EN&amp;quot; &amp;quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&amp;quot;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;script &lt;/span&gt;&lt;span style="color: red"&gt;runat&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;server&amp;quot;&amp;gt;
    
    protected void &lt;/span&gt;Page_Load(&lt;span style="color: blue"&gt;object &lt;/span&gt;sender, &lt;span style="color: #2b91af"&gt;EventArgs &lt;/span&gt;e)
    {   &lt;span style="color: green"&gt;// The following is a simple method for closing a window with client-side code on a button.
        &lt;/span&gt;bClose.Attributes.Add(&lt;span style="color: #a31515"&gt;&amp;quot;onclick&amp;quot;&lt;/span&gt;, &lt;span style="color: #a31515"&gt;&amp;quot;window.close();&amp;quot;&lt;/span&gt;);
    }

    &lt;span style="color: #2b91af"&gt;RemoteCertificateValidationCallback &lt;/span&gt;OriginalValidator;
    
    &lt;span style="color: green"&gt;// This method is only needed if your EWS endpoint has a certificate that is not trusted.
    &lt;/span&gt;&lt;span style="color: blue"&gt;protected void &lt;/span&gt;DisableSSLVerification()
    {   &lt;span style="color: green"&gt;//Save the original validator so that it can be restored
        &lt;/span&gt;OriginalValidator =
            &lt;span style="color: #2b91af"&gt;ServicePointManager&lt;/span&gt;.ServerCertificateValidationCallback;
            
        &lt;span style="color: green"&gt;//Replace with a dummy always-true validator
        &lt;/span&gt;&lt;span style="color: #2b91af"&gt;ServicePointManager&lt;/span&gt;.ServerCertificateValidationCallback =
            &lt;span style="color: blue"&gt;delegate&lt;/span&gt;(&lt;span style="color: #2b91af"&gt;Object &lt;/span&gt;obj, 
            &lt;span style="color: #2b91af"&gt;X509Certificate &lt;/span&gt;certificate, 
            &lt;span style="color: #2b91af"&gt;X509Chain &lt;/span&gt;chain, 
            &lt;span style="color: #2b91af"&gt;SslPolicyErrors &lt;/span&gt;errors)
            {
                &lt;span style="color: blue"&gt;return true&lt;/span&gt;;
            };
    }

    &lt;span style="color: blue"&gt;protected void &lt;/span&gt;RestoreVerification()
    {
        &lt;span style="color: green"&gt;//Restore the original validator
        &lt;/span&gt;&lt;span style="color: #2b91af"&gt;ServicePointManager&lt;/span&gt;.ServerCertificateValidationCallback = OriginalValidator;
    }

    &lt;span style="color: blue"&gt;protected string &lt;/span&gt;GenerateXmlPayload()
    {
        &lt;span style="color: green"&gt;//Leverage XmlDocument to put together some well formed xml to save
        //the form data.
        &lt;/span&gt;&lt;span style="color: #2b91af"&gt;XmlDocument &lt;/span&gt;x = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;XmlDocument&lt;/span&gt;();
        x.LoadXml(&lt;span style="color: #a31515"&gt;&amp;quot;&amp;lt;?xml version=\&amp;quot;1.0\&amp;quot; encoding=\&amp;quot;utf-8\&amp;quot;?&amp;gt;\n&amp;lt;HelpTicket/&amp;gt;&amp;quot;&lt;/span&gt;);
        &lt;span style="color: #2b91af"&gt;XmlNode &lt;/span&gt;xTitle = x.CreateElement(&lt;span style="color: #a31515"&gt;&amp;quot;Title&amp;quot;&lt;/span&gt;);
        xTitle.InnerText = tbTitle.Text;
        &lt;span style="color: #2b91af"&gt;XmlNode &lt;/span&gt;xDetails = x.CreateElement(&lt;span style="color: #a31515"&gt;&amp;quot;Details&amp;quot;&lt;/span&gt;);
        xDetails.InnerText = tbDetails.Text;
        &lt;span style="color: #2b91af"&gt;XmlNode &lt;/span&gt;xDate = x.CreateElement(&lt;span style="color: #a31515"&gt;&amp;quot;Date&amp;quot;&lt;/span&gt;);
        xDate.InnerText = System.&lt;span style="color: #2b91af"&gt;DateTime&lt;/span&gt;.Now.ToString();
        &lt;span style="color: #2b91af"&gt;XmlNode &lt;/span&gt;xUser = x.CreateElement(&lt;span style="color: #a31515"&gt;&amp;quot;User&amp;quot;&lt;/span&gt;);
        xUser.InnerText = Page.User.Identity.Name; 
        x.DocumentElement.AppendChild(xTitle);
        x.DocumentElement.AppendChild(xDetails);
        x.DocumentElement.AppendChild(xDate);
        x.DocumentElement.AppendChild(xUser);
        &lt;span style="color: blue"&gt;return &lt;/span&gt;(x.OuterXml);
    }
    
    &lt;span style="color: blue"&gt;protected void &lt;/span&gt;bSubmit_Click(&lt;span style="color: blue"&gt;object &lt;/span&gt;sender, &lt;span style="color: #2b91af"&gt;EventArgs &lt;/span&gt;e)
    {
        &lt;span style="color: blue"&gt;try
        &lt;/span&gt;{
            &lt;span style="color: green"&gt;//Use Page.User.Identity (this is the logged in user) to generate
            //a principal name for the EWS impersonation.
            &lt;/span&gt;&lt;span style="color: blue"&gt;string&lt;/span&gt;[] parts = Page.User.Identity.Name.Split(&lt;span style="color: #a31515"&gt;&amp;quot;\\&amp;quot;&lt;/span&gt;.ToCharArray());
            &lt;span style="color: blue"&gt;string &lt;/span&gt;PrincipalName = parts[1] + &lt;span style="color: #a31515"&gt;&amp;quot;@&amp;quot; &lt;/span&gt;+ parts[0];
            &lt;span style="color: #2b91af"&gt;ExchangeService &lt;/span&gt;exchange = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;ExchangeService&lt;/span&gt;(&lt;span style="color: #2b91af"&gt;ExchangeVersion&lt;/span&gt;.Exchange2007_SP1);
            exchange.ImpersonatedUserId =
                &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;ImpersonatedUserId&lt;/span&gt;(&lt;span style="color: #2b91af"&gt;ConnectingIdType&lt;/span&gt;.PrincipalName, PrincipalName);
            &lt;span style="color: green"&gt;//Set EWS endpoint to local host (may not work for all setups)
            &lt;/span&gt;exchange.Url = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;Uri&lt;/span&gt;(&lt;span style="color: #a31515"&gt;&amp;quot;https://localhost/ews/exchange.asmx&amp;quot;&lt;/span&gt;);
            Microsoft.Exchange.WebServices.Data.&lt;span style="color: #2b91af"&gt;EmailMessage &lt;/span&gt;message =
                &lt;span style="color: blue"&gt;new &lt;/span&gt;Microsoft.Exchange.WebServices.Data.&lt;span style="color: #2b91af"&gt;EmailMessage&lt;/span&gt;(exchange);
            message.Subject = &lt;span style="color: #a31515"&gt;&amp;quot;HELPTICKET: &amp;quot; &lt;/span&gt;+ tbTitle.Text;
            message.Body = &lt;span style="color: #a31515"&gt;&amp;quot;This is a HelpTicket Form&amp;quot;&lt;/span&gt;;
            &lt;span style="color: green"&gt;//Add XML Payload as file attachment.
            &lt;/span&gt;message.Attachments.AddFileAttachment(&lt;span style="color: #a31515"&gt;&amp;quot;FormData.xml&amp;quot;&lt;/span&gt;,
                System.Text.&lt;span style="color: #2b91af"&gt;Encoding&lt;/span&gt;.Default.GetBytes(GenerateXmlPayload()));
            message.ToRecipients.Add(Request.QueryString[&lt;span style="color: #a31515"&gt;&amp;quot;ea&amp;quot;&lt;/span&gt;]);
            &lt;span style="color: green"&gt;//Set ItemClass so that our custom viewing form will be used.
            &lt;/span&gt;message.ItemClass = &lt;span style="color: #a31515"&gt;&amp;quot;IPM.Note.HelpTicket&amp;quot;&lt;/span&gt;;
            &lt;span style="color: green"&gt;//DisableSSLVerification(); //Uncomment these lines if your CAS server's certificate is not trusted
            &lt;/span&gt;message.SendAndSaveCopy();
            &lt;span style="color: green"&gt;//RestoreVerification();    //Uncomment these lines if your CAS server's certificate is not trusted

            //Set fields to ReadOnly and hide/show appropriate buttons            
            &lt;/span&gt;bSubmit.Visible  = &lt;span style="color: blue"&gt;false&lt;/span&gt;;
            bClose.Visible = &lt;span style="color: blue"&gt;true&lt;/span&gt;;
            tbTitle.ReadOnly = &lt;span style="color: blue"&gt;true&lt;/span&gt;;
            tbDetails.ReadOnly = &lt;span style="color: blue"&gt;true&lt;/span&gt;;
        }
        &lt;span style="color: blue"&gt;catch &lt;/span&gt;(&lt;span style="color: #2b91af"&gt;Exception &lt;/span&gt;ex)
        {
            &lt;span style="color: green"&gt;//If we get an exception, dump it to the user
            &lt;/span&gt;lDiag.Text = ex.ToString();
        }
    }
&lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;script&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;html &lt;/span&gt;&lt;span style="color: red"&gt;xmlns&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;head &lt;/span&gt;&lt;span style="color: red"&gt;id&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Head1&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;runat&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;server&amp;quot;&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;title&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;New Helpdesk Ticket&lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;title&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;head&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;body &lt;/span&gt;&lt;span style="color: red"&gt;style&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;&lt;/span&gt;&lt;span style="color: red"&gt;background-color&lt;/span&gt;:&lt;span style="color: blue"&gt;#E0E0F0&lt;/span&gt;;&lt;span style="color: blue"&gt;&amp;quot;&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;form &lt;/span&gt;&lt;span style="color: red"&gt;id&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;form1&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;runat&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;server&amp;quot;&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;div&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;h2 &lt;/span&gt;&lt;span style="color: red"&gt;style&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;&lt;/span&gt;&lt;span style="color: red"&gt;text-align&lt;/span&gt;:&lt;span style="color: blue"&gt;center&lt;/span&gt;;&lt;span style="color: blue"&gt;&amp;quot;&amp;gt;&lt;/span&gt;Create a new Helpdesk Ticket&lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;h2&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
        &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;table &lt;/span&gt;&lt;span style="color: red"&gt;style&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;&lt;/span&gt;&lt;span style="color: red"&gt;width&lt;/span&gt;:&lt;span style="color: blue"&gt;100%&lt;/span&gt;;&lt;span style="color: red"&gt;border-style&lt;/span&gt;:&lt;span style="color: blue"&gt;groove&lt;/span&gt;;&lt;span style="color: red"&gt;background-color&lt;/span&gt;:&lt;span style="color: blue"&gt;White&lt;/span&gt;;&lt;span style="color: blue"&gt;&amp;quot;&amp;gt;
            &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;tr&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
                &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;td &lt;/span&gt;&lt;span style="color: red"&gt;style&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;&lt;/span&gt;&lt;span style="color: red"&gt;width&lt;/span&gt;:&lt;span style="color: blue"&gt;150px&lt;/span&gt;;&lt;span style="color: blue"&gt;&amp;quot;&amp;gt;
                    &lt;/span&gt;Issue Title&lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;td&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
                &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;td &lt;/span&gt;&lt;span style="color: red"&gt;style&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;&lt;/span&gt;&lt;span style="color: red"&gt;width&lt;/span&gt;:&lt;span style="color: blue"&gt;auto&lt;/span&gt;;&lt;span style="color: blue"&gt;&amp;quot;&amp;gt;
                    &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;asp&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;TextBox &lt;/span&gt;&lt;span style="color: red"&gt;ID&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;tbTitle&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;runat&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;server&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Width&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;99%&amp;quot;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;asp&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;TextBox&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;td&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
            &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;tr&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
            &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;tr&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
                &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;td&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
                    &lt;/span&gt;Details&lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;td&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
                &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;td&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
                    &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;asp&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;TextBox &lt;/span&gt;&lt;span style="color: red"&gt;ID&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;tbDetails&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;runat&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;server&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Width&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;99%&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Rows&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;10&amp;quot; 
                        &lt;/span&gt;&lt;span style="color: red"&gt;TextMode&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;MultiLine&amp;quot;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;asp&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;TextBox&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;td&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
            &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;tr&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
        &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;table&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
        &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;br &lt;/span&gt;&lt;span style="color: blue"&gt;/&amp;gt;
        &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;asp&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;Button &lt;/span&gt;&lt;span style="color: red"&gt;ID&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;bSubmit&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;runat&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;server&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Text&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Submit&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;style&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;&lt;/span&gt;&lt;span style="color: red"&gt;width&lt;/span&gt;:&lt;span style="color: blue"&gt;100%&amp;quot; 
            &lt;/span&gt;&lt;span style="color: red"&gt;onclick&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;bSubmit_Click&amp;quot; /&amp;gt;
        &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;asp&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;Button &lt;/span&gt;&lt;span style="color: red"&gt;ID&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;bClose&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;runat&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;server&amp;quot; 
            &lt;/span&gt;&lt;span style="color: red"&gt;Text&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Ticket Submitted, Click to Close Window&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;style&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;&lt;/span&gt;&lt;span style="color: red"&gt;width&lt;/span&gt;:&lt;span style="color: blue"&gt;100%&amp;quot; 
            &lt;/span&gt;&lt;span style="color: red"&gt;Visible&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;False&amp;quot; /&amp;gt;
    
    &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;div&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;asp&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;Label &lt;/span&gt;&lt;span style="color: red"&gt;ID&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;lDiag&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;runat&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;server&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Text&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Font-Italic&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;True&amp;quot;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;asp&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;Label&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
    &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;form&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;body&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;html&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
&lt;/span&gt;&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;With the customizations in place from&lt;a href="http://blogs.msdn.com/rickhall/archive/2009/01/28/exchange-server-2007-sp1-outlook-web-access-customization-part-1-registry-xml.aspx"&gt; Part 1&lt;/a&gt; and &lt;a href="http://blogs.msdn.com/rickhall/archive/2009/03/24/exchange-server-2007-sp1-outlook-web-access-customization-part-2-uiextensions-xml.aspx"&gt;Part 2&lt;/a&gt;, and the &lt;em&gt;&lt;strong&gt;NewHelpTicket.ASPX&lt;/strong&gt;&lt;/em&gt; saved in &lt;strong&gt;&lt;em&gt;C:\Program Files\Microsoft\Exchange Server\ClientAccess\Owa\forms\HelpTicket&lt;/em&gt;&lt;/strong&gt;, you should get the following form when you click the “New Helpdesk Ticket” link from the “New” menu in Outlook Web Access.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/rickhall/WindowsLiveWriter/ExchangeServer2007SP1OutlookWebAcce.ASPX_96E9/image_2.png" target="_blank"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/rickhall/WindowsLiveWriter/ExchangeServer2007SP1OutlookWebAcce.ASPX_96E9/image_thumb.png" width="644" height="379" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;In Part 4 of this series, I will present sample &lt;strong&gt;&lt;em&gt;ViewHelpTicket.ASPX&lt;/em&gt;&lt;/strong&gt; that can unpack the attached XML and display it in a format similar to the New Helpdesk Ticket form.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9900421" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/rickhall/archive/tags/Exchange/default.aspx">Exchange</category><category domain="http://blogs.msdn.com/rickhall/archive/tags/DevMsgTeam/default.aspx">DevMsgTeam</category><category domain="http://blogs.msdn.com/rickhall/archive/tags/OWA/default.aspx">OWA</category><category domain="http://blogs.msdn.com/rickhall/archive/tags/EWS/default.aspx">EWS</category></item><item><title>Exchange Server 2007 SP1, Outlook Web Access Customization: Part 2, UIExtensions.xml</title><link>http://blogs.msdn.com/rickhall/archive/2009/03/24/exchange-server-2007-sp1-outlook-web-access-customization-part-2-uiextensions-xml.aspx</link><pubDate>Tue, 24 Mar 2009 21:49:29 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9504972</guid><dc:creator>Rick_H</dc:creator><slash:comments>8</slash:comments><comments>http://blogs.msdn.com/rickhall/comments/9504972.aspx</comments><wfw:commentRss>http://blogs.msdn.com/rickhall/commentrss.aspx?PostID=9504972</wfw:commentRss><description>&lt;p&gt;&lt;em&gt;I’ve seen a few cases come through where customer’s are trying to implement the customization features that were introduced with Exchange Server 2007 SP1.&amp;#160; There’s a few key areas that seem to cause trouble so I figured it would be worth walking through a simple scenario that covered many of the different aspects. (&lt;a href="http://blogs.msdn.com/rickhall/archive/2009/01/28/exchange-server-2007-sp1-outlook-web-access-customization-part-1-registry-xml.aspx" target="_blank"&gt;Link to Part 1 of the series&lt;/a&gt;)&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;We continue our effort to implement our HelpTicket Outlook Web Access form by adding an element to the UIExtensions.xml file in the &lt;em&gt;C:\Program Files\Microsoft\Exchange Server\ClientAccess\Owa\forms\Customization &lt;/em&gt;directory.&amp;#160; This file allows you to make a few different types of customizations (all covered in more detail &lt;a href="http://msdn.microsoft.com/en-us/library/bb891875.aspx" target="_blank"&gt;here&lt;/a&gt;), but the one that we are interested in is the inclusion of a new element in the &lt;strong&gt;New&lt;/strong&gt; dropdown in the OWA Interface like so:&lt;/p&gt;  &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/rickhall/WindowsLiveWriter/ExchangeServer2007SP1OutlookWebAcces.xml_CF9D/image_3.png" width="624" height="458" /&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;The following example &lt;em&gt;UIExtensions.xml&lt;/em&gt; file only contains the minimum tags needed for our scenario, but there is a “.template” version of the file in the Customization directory that has samples for the other customization types as well.&lt;/p&gt;  &lt;blockquote&gt;   &lt;table border="1" cellspacing="0" cellpadding="1" width="550"&gt;&lt;tbody&gt;       &lt;tr&gt;         &lt;td valign="top" width="550"&gt;&lt;span style="color: blue"&gt;             &lt;br /&gt;&amp;lt;?&lt;/span&gt;&lt;span style="color: #a31515"&gt;xml&lt;/span&gt;&lt;span style="color: red"&gt;version&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;1.0&lt;/span&gt;&amp;quot; &lt;span style="color: red"&gt;encoding&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;UTF-8&lt;/span&gt;&amp;quot; &lt;span style="color: blue"&gt;?&amp;gt;             &lt;br /&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;OWAUICustomizations&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;             &lt;br /&gt;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;NewItemMenuEntries&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;             &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;NewItemMenuEntry &lt;/span&gt;&lt;span style="color: red"&gt;ItemType&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;IPM.Note.HelpTicket&lt;/span&gt;&amp;quot; &lt;span style="color: red"&gt;Icon&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;ticket.gif&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;&amp;gt;             &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;string&lt;/span&gt;&lt;span style="color: red"&gt;language&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;en-us&lt;/span&gt;&amp;quot; &lt;span style="color: red"&gt;text&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;New Helpdesk Ticket&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;/&amp;gt;             &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;NewItemMenuEntry&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;             &lt;br /&gt;&amp;#160; &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;NewItemMenuEntries&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;             &lt;br /&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;OWAUICustomizations&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;             &lt;br /&gt;&lt;/span&gt;&lt;/td&gt;       &lt;/tr&gt;     &lt;/tbody&gt;&lt;/table&gt;    &lt;p&gt;&lt;em&gt;Note:&amp;#160; the Icon attribute of the NewItemMenuEntry tag specifies the icon to utilize and Exchange looks for this file in the directory where the UIExtensions.xml file is located. To be consistent with the other icons this should be a 16x16 square image that can be displayed in a browser, such as a .gif, .jpg, or .png.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Place the &lt;em&gt;UIExtensions.xml&lt;/em&gt; and your &lt;em&gt;ticket.gif&amp;#160; &lt;/em&gt;files into &lt;em&gt;C:\Program Files\Microsoft\Exchange Server\ClientAccess\Owa\forms\Customization &lt;/em&gt;and restart IIS with “iisreset /noforce” and you should have a new element in the “New” dropdown in OWA.&lt;/p&gt;  &lt;p&gt;Just like for the &lt;em&gt;Registry.xml&lt;/em&gt; file, the Event viewer is the best place to start if you are troubleshooting a problem with &lt;em&gt;UIExtensions.xml&lt;/em&gt;.&amp;#160; OWA does not write an entry for a successful read of &lt;em&gt;UIExtensions.xml&lt;/em&gt;, but you will see an error EventId &lt;strong&gt;&lt;em&gt;72&lt;/em&gt;&lt;/strong&gt; with a source of &lt;strong&gt;&lt;em&gt;MSExchange OWA&lt;/em&gt;&lt;/strong&gt; if there is an error parsing this file, similar to this:&lt;/p&gt;  &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/rickhall/WindowsLiveWriter/ExchangeServer2007SP1OutlookWebAcces.xml_CF9D/image_14.png" width="630" height="444" /&gt;&amp;#160;&amp;#160; &lt;/p&gt;  &lt;p&gt;If you have completed the steps from &lt;a href="http://blogs.msdn.com/rickhall/archive/2009/01/28/exchange-server-2007-sp1-outlook-web-access-customization-part-1-registry-xml.aspx" target="_blank"&gt;Part 1&lt;/a&gt; and also put in place a dummy &lt;em&gt;NewHelpTicket.ASPX&lt;/em&gt; file (this can just be a text or html file saved in the directory referenced in Part 1), then you should be able to launch the form by clicking the “New Help Ticket” item in the New dropdown in OWA.&lt;/p&gt;  &lt;p&gt;In Part 3 of this series we will look at building the &lt;em&gt;NewHelpTicket.ASPX&lt;/em&gt; file and using Exchange Web Services to create a new mail item to represent our helpticket.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9504972" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/rickhall/archive/tags/Exchange/default.aspx">Exchange</category><category domain="http://blogs.msdn.com/rickhall/archive/tags/DevMsgTeam/default.aspx">DevMsgTeam</category><category domain="http://blogs.msdn.com/rickhall/archive/tags/OWA/default.aspx">OWA</category></item><item><title>Using Powershell’s new-webserviceproxy with Exchange Web Services</title><link>http://blogs.msdn.com/rickhall/archive/2009/03/19/using-powershell-s-new-webserviceproxy-with-exchange-web-services.aspx</link><pubDate>Thu, 19 Mar 2009 19:55:33 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9490499</guid><dc:creator>Rick_H</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/rickhall/comments/9490499.aspx</comments><wfw:commentRss>http://blogs.msdn.com/rickhall/commentrss.aspx?PostID=9490499</wfw:commentRss><description>&lt;p&gt;The other day I was working on a case where the customer was using VBScript and CDO 1.21 to make some changes in some mailboxes, and I couldn’t help but feel that we were working in the past.&amp;nbsp; Don’t get me wrong, there’s a lot of tried and tested VBScript and CDO 1.21 code out there, but I found myself wondering what the “new” way to do this would be.&lt;/p&gt; &lt;p&gt;I started looking at using Powershell to automate a .Net HttpWebRequest to post to an EWS endpoint, and just build the SOAP requests myself (or leverage an XmlDocument), but while I was researching this I stumbled upon something slightly more interesting.&lt;/p&gt; &lt;p&gt;The version of Powershell that is included with the Windows 7 Beta includes a new cmdlet called &lt;strong&gt;new-webserviceproxy&lt;/strong&gt; and it does exactly what it sounds like.&amp;nbsp; You can point it at a wsdl file, and it auto-generates a proxy in a way that seems very similar to the Visual Studio auto-generated proxies.&lt;/p&gt; &lt;p&gt;The following is the result of a good deal of trial and error, but what you end up with is a output that displays some basic information about all of the emails in your inbox.&lt;/p&gt;&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt; &lt;style type="text/css"&gt;



.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}

.csharpcode pre { margin: 0em; }

.csharpcode .rem { color: #008000; }

.csharpcode .kwrd { color: #0000ff; }

.csharpcode .str { color: #006080; }

.csharpcode .op { color: #0000c0; }

.csharpcode .preproc { color: #cc6633; }

.csharpcode .asp { background-color: #ffff00; }

.csharpcode .html { color: #800000; }

.csharpcode .attr { color: #ff0000; }

.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}

.csharpcode .lnum { color: #606060; }&lt;/style&gt;  &lt;div class="csharpcode"&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&amp;lt;&lt;span class="rem"&gt;# Untested sample code, use at your own risk! #&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;div class="csharpcode"&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;/div&gt;
&lt;div class="csharpcode"&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;&lt;span class="rem"&gt;## Setup the Exchange Service Binding&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;div class="csharpcode"&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;$uri = &lt;span class="str"&gt;"https://exchangeserver/ews/exchange.asmx"&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;div class="csharpcode"&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;$exchangeservicebinding = new-webserviceproxy -NameSpace &lt;span class="str"&gt;"EWS"&lt;/span&gt; -URI $uri -UseDefaultCredential &lt;/pre&gt;&lt;/div&gt;
&lt;div class="csharpcode"&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;$exchangeservicebinding.RequestServerVersionValue = new-object EWS.RequestServerVersion&lt;/pre&gt;&lt;/div&gt;
&lt;div class="csharpcode"&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;$exchangeservicebinding.RequestServerVersionValue.Version = [EWS.ExchangeVersionType]::Exchange2007_SP1&lt;/pre&gt;&lt;/div&gt;
&lt;div class="csharpcode"&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;$exchangeservicebinding.Url = $uri&lt;/pre&gt;&lt;/div&gt;
&lt;div class="csharpcode"&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;/div&gt;
&lt;div class="csharpcode"&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;&lt;span class="rem"&gt;## Create and Populate the Parent Folder ID Collection&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;div class="csharpcode"&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;[EWS.DistinguishedFolderIdType]$parentfolderid = new-object EWS.DistinguishedFolderIdType&lt;/pre&gt;&lt;/div&gt;
&lt;div class="csharpcode"&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt;$parentfolderid.Id = [EWS.DistinguishedFolderIdNameType]::inbox&lt;/pre&gt;&lt;/div&gt;
&lt;div class="csharpcode"&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  13:  &lt;/span&gt;[EWS.BaseFolderIdType[]]$parentfolderids = $parentfolderid&lt;/pre&gt;&lt;/div&gt;
&lt;div class="csharpcode"&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  14:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;/div&gt;
&lt;div class="csharpcode"&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  15:  &lt;/span&gt;&lt;span class="rem"&gt;## Create an ItemShape and set it to return All Properties&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;div class="csharpcode"&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  16:  &lt;/span&gt;[EWS.ItemResponseShapeType]$itemshape = new-object EWS.ItemResponseShapeType&lt;/pre&gt;&lt;/div&gt;
&lt;div class="csharpcode"&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  17:  &lt;/span&gt;$itemshape.BaseShape = [EWS.DefaultShapeNamesType]::AllProperties&lt;/pre&gt;&lt;/div&gt;
&lt;div class="csharpcode"&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  18:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;/div&gt;
&lt;div class="csharpcode"&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  19:  &lt;/span&gt;&lt;span class="rem"&gt;## Create the FindItemType object and populate with the Parent Folder Ids and Item Shape&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;div class="csharpcode"&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  20:  &lt;/span&gt;[EWS.FindItemType]$finditemtype = new-object EWS.FindItemType&lt;/pre&gt;&lt;/div&gt;
&lt;div class="csharpcode"&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  21:  &lt;/span&gt;$finditemtype.ParentFolderIds = $parentfolderids&lt;/pre&gt;&lt;/div&gt;
&lt;div class="csharpcode"&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  22:  &lt;/span&gt;$finditemtype.ItemShape = $itemshape&lt;/pre&gt;&lt;/div&gt;
&lt;div class="csharpcode"&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  23:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;/div&gt;
&lt;div class="csharpcode"&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  24:  &lt;/span&gt;&lt;span class="rem"&gt;## Make the call to the webservice&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;div class="csharpcode"&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  25:  &lt;/span&gt;[EWS.FindItemResponseType]$finditemresponses = $exchangeservicebinding.FindItem($finditemtype)&lt;/pre&gt;&lt;/div&gt;
&lt;div class="csharpcode"&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  26:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;/div&gt;
&lt;div class="csharpcode"&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  27:  &lt;/span&gt;&lt;span class="rem"&gt;## Loop through the returned messages and print some basic info&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;div class="csharpcode"&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  28:  &lt;/span&gt;[EWS.MessageType]$messagetype&lt;/pre&gt;&lt;/div&gt;
&lt;div class="csharpcode"&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  29:  &lt;/span&gt;&lt;span class="kwrd"&gt;foreach&lt;/span&gt;($messagetype &lt;span class="kwrd"&gt;in&lt;/span&gt; $finditemresponses.ResponseMessages.Items[0].RootFolder.Item.Items)&lt;/pre&gt;&lt;/div&gt;
&lt;div class="csharpcode"&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  30:  &lt;/span&gt;{&lt;/pre&gt;&lt;/div&gt;
&lt;div class="csharpcode"&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  31:  &lt;/span&gt;    Write-Host &lt;span class="str"&gt;"From: "&lt;/span&gt; $messagetype.From.Item.Name&lt;/pre&gt;&lt;/div&gt;
&lt;div class="csharpcode"&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  32:  &lt;/span&gt;    Write-Host &lt;span class="str"&gt;"Subject: "&lt;/span&gt; $messagetype.Subject&lt;/pre&gt;&lt;/div&gt;
&lt;div class="csharpcode"&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  33:  &lt;/span&gt;    Write-Host &lt;span class="str"&gt;"Received: "&lt;/span&gt; $messagetype.DateTimeReceived.Date&lt;/pre&gt;&lt;/div&gt;
&lt;div class="csharpcode"&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  34:  &lt;/span&gt;    Write-Host &lt;span class="str"&gt;"-------------------------------------------------------"&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;div class="csharpcode"&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  35:  &lt;/span&gt;    Write-Host &lt;span class="str"&gt;"ItemId: "&lt;/span&gt; $messagetype.ItemId.Id&lt;/pre&gt;&lt;/div&gt;
&lt;div class="csharpcode"&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  36:  &lt;/span&gt;    Write-Host &lt;span class="str"&gt;"======================================================="&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;div class="csharpcode"&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  37:  &lt;/span&gt;    Write-Host&lt;/pre&gt;&lt;/div&gt;
&lt;div class="csharpcode"&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  38:  &lt;/span&gt;}&lt;/pre&gt;&lt;/div&gt;
&lt;div class="csharpcode"&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  39:  &lt;/span&gt;&lt;span class="rem"&gt;&amp;lt;# &lt;a href="http://rickhallihan.com/files/samples/ews_ps_sample.ps1.txt"&gt;download code here&lt;/a&gt; #&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The above code obviously has no error handling, but hopefully it shows a basic example of how this new cmdlet can be used.&lt;/p&gt;
&lt;p&gt;If you want to dig in further, make use of the &lt;strong&gt;get-member&lt;/strong&gt; cmdlet to examine objects of the types that are generated by the proxy, and you can also inspect the object using &lt;strong&gt;format-custom&lt;/strong&gt; (alias fc) as follows (This can be done for any of the object types in the above code):&lt;/p&gt;
&lt;div class="csharpcode"&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;$exchangeservicebinding | get-member&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;$exchangeservicebinding | fc&lt;/pre&gt;&lt;pre&gt;&amp;nbsp;&lt;/pre&gt;&lt;/div&gt;&lt;em&gt;Note: I did notice some strange errors if I run the above code multiple times within the same powershell session. I’ll update this post if I figure it out why, but if you receive errors about missing DLLs or if powershell claims that it “Can’t convert from type “EWS.FindItemType” to “EWS.FindItemType” then try starting a new PowerShell session.&lt;/em&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9490499" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/rickhall/archive/tags/Exchange/default.aspx">Exchange</category><category domain="http://blogs.msdn.com/rickhall/archive/tags/DevMsgTeam/default.aspx">DevMsgTeam</category><category domain="http://blogs.msdn.com/rickhall/archive/tags/EWS/default.aspx">EWS</category><category domain="http://blogs.msdn.com/rickhall/archive/tags/Powershell/default.aspx">Powershell</category></item><item><title>What are the Supported Ways To Customize Outlook Web Access for Exchange Server 2007 SP1?</title><link>http://blogs.msdn.com/rickhall/archive/2009/02/04/what-are-the-supported-ways-to-customize-outlook-web-access-for-exchange-server-2007-sp1.aspx</link><pubDate>Wed, 04 Feb 2009 20:57:52 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9396240</guid><dc:creator>Rick_H</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/rickhall/comments/9396240.aspx</comments><wfw:commentRss>http://blogs.msdn.com/rickhall/commentrss.aspx?PostID=9396240</wfw:commentRss><description>&lt;p&gt;We seem to get a fair amount of questions and cases where the supportability of certain OWA customizations isn’t clear.&amp;#160; In the past, many organizations have found ingenuous ways to modify the OWA files on the server in order to make them behave in different ways.&amp;#160; Unfortunately, changing these files takes you into uncharted territory.&amp;#160; The OWA web application undergoes extensive testing, and when Microsoft makes &lt;em&gt;any&lt;/em&gt; changed to these files, it has to go through testing again.&amp;#160; If you modify a javascript or aspx file, then you are running OWA in an &lt;a href="http://blogs.msdn.com/pcreehan/archive/2007/05/04/what-does-unsupported-mean.aspx" target="_blank"&gt;untested and unsupported&lt;/a&gt; configuration.&lt;/p&gt;  &lt;p&gt;Now, many companies have gone outside of the “supported” realm and made these types of changes anyway, and hopefully they do their own testing to make sure that they aren’t introducing errors.&amp;#160; Unfortunately this isn’t quite enough.&amp;#160; Prior to Exchange Server 2007 SP1 RU5, the update installer would &lt;em&gt;&lt;strong&gt;not&lt;/strong&gt;&lt;/em&gt; update files that had been altered.&amp;#160; This meant that if you made a change to a file such as &lt;em&gt;logon.aspx&lt;/em&gt;, the file wouldn’t get replaced with the latest version.&amp;#160; For many installations, this behavior simply meant that the customizations would “stick” through the update.&amp;#160; The note above about being in an untested configuration still applies, and you have the added consequence of negating any testing that &lt;em&gt;you&lt;/em&gt; did when you initially made the change.&amp;#160; Things can get worse though.&amp;#160; There were some changes made to OWA with SP1 RU3 that &lt;em&gt;depend &lt;/em&gt;on an updated &lt;em&gt;logon.aspx&lt;/em&gt; file.&amp;#160; If you had made changes to that file prior to SP1 RU3 and you apply RU3 or RU4, OWA ceases to function.&amp;#160; This behavior is noted in the release notes for &lt;a href="http://support.microsoft.com/kb/949870/" target="_blank"&gt;SP1 RU3&lt;/a&gt; and &lt;a href="http://support.microsoft.com/kb/952580" target="_blank"&gt;SP1 RU4&lt;/a&gt;, and documented in &lt;a href="http://support.microsoft.com/kb/956582 " target="_blank"&gt;KB 956582&lt;/a&gt;.&amp;#160; &lt;a href="http://support.microsoft.com/kb/953467/" target="_blank"&gt;Exchange Server 2007 SP1 RU5&lt;/a&gt; changed this behavior to always replace files even if they have been changed, so that an update doesn’t cause OWA to stop working, but this means that modified files can be replaced.&lt;/p&gt;  &lt;p&gt;So, what are the &lt;em&gt;supported&lt;/em&gt; ways to customize OWA?&amp;#160; The short answer is:&amp;#160; &lt;strong&gt;“If you can find documentation about how to do it on &lt;/strong&gt;&lt;a href="http://msdn.microsoft.com" target="_blank"&gt;&lt;strong&gt;MSDN&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt; or &lt;a href="http://technet.microsoft.com"&gt;Technet&lt;/a&gt;, then it is supported.”&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Here’s some information on the supported scenarios:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/aa579439.aspx"&gt;Outlook Web Access Customization Architecture&lt;/a&gt; – Overview of how OWA Customization works.&lt;/p&gt;  &lt;p&gt;&lt;a title="http://msdn.microsoft.com/en-us/library/bb891875.aspx" href="http://msdn.microsoft.com/en-us/library/bb891875.aspx"&gt;Outlook Web Access User Interface Customization&lt;/a&gt; – You can add elements to the navigation bar and the “New” dropdown.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/bb891879.aspx"&gt;Outlook Web Access Forms Registry&lt;/a&gt; – You can register new custom forms to be used for specific item classes (Note: this only works for the default mail folder view in OWA, and won’t work for other folders like the Calendar).&lt;/p&gt;  &lt;p&gt;&lt;a href="http://technet.microsoft.com/en-us/library/bb201700.aspx"&gt;How to Create a Theme for Outlook Web Access&lt;/a&gt; – You can customize the look and feel of the OWA client, including the logon and logoff pages*.&amp;#160; &lt;/p&gt;  &lt;p&gt;&lt;em&gt;* A special note for branding of the logon and logoff pages:&amp;#160; These changes are limited to the image files and the logon.css file in the Base theme directory.&amp;#160; This is necessary because without a logged in session, the server has no way to check what theme or experience (Basic or Premium) it should use.&amp;#160; Updates to Exchange create a new version-based folder for themes and the modified files should be copied forward. You should plan to test logon and logoff screen customizations after an update to make sure that the non-modified files haven’t changed in a way that causes a problem with your customizations.&lt;/em&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9396240" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/rickhall/archive/tags/Exchange/default.aspx">Exchange</category><category domain="http://blogs.msdn.com/rickhall/archive/tags/DevMsgTeam/default.aspx">DevMsgTeam</category><category domain="http://blogs.msdn.com/rickhall/archive/tags/OWA/default.aspx">OWA</category></item><item><title>Exchange Server 2007 SP1, Outlook Web Access Customization: Part 1, registry.xml</title><link>http://blogs.msdn.com/rickhall/archive/2009/01/28/exchange-server-2007-sp1-outlook-web-access-customization-part-1-registry-xml.aspx</link><pubDate>Thu, 29 Jan 2009 00:20:32 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9381822</guid><dc:creator>Rick_H</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/rickhall/comments/9381822.aspx</comments><wfw:commentRss>http://blogs.msdn.com/rickhall/commentrss.aspx?PostID=9381822</wfw:commentRss><description>&lt;p&gt;&lt;em&gt;I’ve seen a few cases come through where customer’s are trying to implement the customization features that were introduced with Exchange Server 2007 SP1.&amp;#160; There’s a few key areas that seem to cause trouble so I figured it would be worth walking through a simple scenario that covered many of the different aspects.&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;The simple (and contrived) scenario that I’m going to run through is the use of a custom message type to represent a helpdesk request.&amp;#160; This example will cover composing, sending and viewing this custom type, and we’re going to redirect the Reply and Forward actions to the viewing form to effectively disable that functionality.&amp;#160; We’re also not going to handle the different states such as “DRAFT” but these concepts are extensions of the scenario that I’ll cover here.&lt;/p&gt;  &lt;p&gt;The first order of business is to decide on the item class that you want to use for your custom items.&amp;#160; For this sample I’ll use &lt;em&gt;IPM.Note.HelpTicket&lt;/em&gt; as the item class.&amp;#160; We’ll use this class for the forms registry (&lt;em&gt;Registry.XML&lt;/em&gt;), the UI Extension definition (&lt;em&gt;UIExtensions.xml&lt;/em&gt;), and we’ll have to set it properly when we create and send the new message.&lt;/p&gt;  &lt;p&gt;In reality, the only folders that actually support custom form registration are folders that utilize the default Mail Folder view in Outlook Web Access.&amp;#160; We’re working on updating the documentation on MSDN to more accurately reflect this limitation.&amp;#160; The custom forms registry is an extension of the internal workings of OWA, so there may be some other scenarios that work or partially work, but those scenarios are not tested or supported.&lt;/p&gt;  &lt;p&gt;So, let’s get started.&amp;#160; The &lt;em&gt;Registry.XML &lt;/em&gt;file is split into two sections.&amp;#160; The first section identifies the class, actions, and states the mapping applies to, as well as the target form that should be used.&amp;#160; The second section is basically a hook that is required so that the first section will be applied by OWA.&lt;/p&gt;  &lt;p&gt;The following example &lt;em&gt;Registry.XML &lt;/em&gt;file creates a for the &lt;em&gt;IPM.Note.HelpTicket &lt;/em&gt;class and maps the New action to the &lt;em&gt;NewHelpTicket.ASPX&lt;/em&gt; form, and it maps the Open, Preview, Reply, ReplyAll and Forward actions to the &lt;em&gt;ViewHelpTicket.ASPX&lt;/em&gt; form.&lt;/p&gt;  &lt;blockquote&gt;   &lt;table style="background-color: white; word-wrap: break-word" border="1" cellspacing="0" cellpadding="1" width="650"&gt;&lt;tbody&gt;       &lt;tr&gt;         &lt;td valign="top" width="650"&gt;           &lt;pre class="code"&gt;&lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Registry &lt;/span&gt;&lt;span style="color: red"&gt;xmlns&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;http://schemas.microsoft.com/exchange/2004/02/formsregistry.xsd&lt;/span&gt;&amp;quot;
          &lt;span style="color: red"&gt;Name&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;PremiumExtensions&lt;/span&gt;&amp;quot; &lt;span style="color: red"&gt;InheritsFrom&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;Premium&lt;/span&gt;&amp;quot; &lt;span style="color: red"&gt;IsRichClient&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;true&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;&amp;gt;
  &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Experience &lt;/span&gt;&lt;span style="color: red"&gt;Name&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;Premium&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Client &lt;/span&gt;&lt;span style="color: red"&gt;Application&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;MSIE&lt;/span&gt;&amp;quot; &lt;span style="color: red"&gt;MinimumVersion&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;6&lt;/span&gt;&amp;quot; &lt;span style="color: red"&gt;Platform&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;Windows NT&lt;/span&gt;&amp;quot; &lt;span style="color: blue"&gt;/&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Client &lt;/span&gt;&lt;span style="color: red"&gt;Application&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;MSIE&lt;/span&gt;&amp;quot; &lt;span style="color: red"&gt;MinimumVersion&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;6&lt;/span&gt;&amp;quot; &lt;span style="color: red"&gt;Platform&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;Windows 2000&lt;/span&gt;&amp;quot; &lt;span style="color: blue"&gt;/&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Client &lt;/span&gt;&lt;span style="color: red"&gt;Application&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;MSIE&lt;/span&gt;&amp;quot; &lt;span style="color: red"&gt;MinimumVersion&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;6&lt;/span&gt;&amp;quot; &lt;span style="color: red"&gt;Platform&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;Windows 98; Win 9x 4.90&lt;/span&gt;&amp;quot; &lt;span style="color: blue"&gt;/&amp;gt;

    &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;ApplicationElement &lt;/span&gt;&lt;span style="color: red"&gt;Name&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;Item&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;&amp;gt;
      &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;ElementClass &lt;/span&gt;&lt;span style="color: red"&gt;Value&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;IPM.Note.HelpTicket&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;&amp;gt;
        &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Mapping &lt;/span&gt;&lt;span style="color: red"&gt;Action&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;Open&lt;/span&gt;&amp;quot;
                 &lt;span style="color: red"&gt;Form&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;ViewHelpTicket.ASPX&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;/&amp;gt;
        &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Mapping &lt;/span&gt;&lt;span style="color: red"&gt;Action&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;Preview&lt;/span&gt;&amp;quot;
                 &lt;span style="color: red"&gt;Form&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;ViewHelpTicket.ASPX&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;/&amp;gt;
        &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Mapping &lt;/span&gt;&lt;span style="color: red"&gt;Action&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;Reply&lt;/span&gt;&amp;quot;
                 &lt;span style="color: red"&gt;Form&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;ViewHelpTicket.ASPX&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;/&amp;gt;
        &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Mapping &lt;/span&gt;&lt;span style="color: red"&gt;Action&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;ReplyAll&lt;/span&gt;&amp;quot;
                 &lt;span style="color: red"&gt;Form&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;ViewHelpTicket.ASPX&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;/&amp;gt;
        &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Mapping &lt;/span&gt;&lt;span style="color: red"&gt;Action&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;Forward&lt;/span&gt;&amp;quot;
                 &lt;span style="color: red"&gt;Form&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;ViewHelpTicket.ASPX&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;/&amp;gt;
        &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Mapping &lt;/span&gt;&lt;span style="color: red"&gt;Action&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;New&lt;/span&gt;&amp;quot;
                 &lt;span style="color: red"&gt;Form&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;NewHelpTicket.ASPX&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;/&amp;gt;
      &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;ElementClass&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
    &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;ApplicationElement&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;

    &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;ApplicationElement &lt;/span&gt;&lt;span style="color: red"&gt;Name&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;PreFormAction&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;&amp;gt;
      &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;ElementClass &lt;/span&gt;&lt;span style="color: red"&gt;Value&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;IPM.Note.HelpTicket&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;&amp;gt;
        &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Mapping &lt;/span&gt;&lt;span style="color: red"&gt;Action&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;Open&lt;/span&gt;&amp;quot;
&lt;span style="color: red"&gt;Form&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;Microsoft.Exchange.Clients.Owa.Premium.Controls.CustomFormRedirectPreFormAction,Microsoft.Exchange.Clients.Owa&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;/&amp;gt;
        &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Mapping &lt;/span&gt;&lt;span style="color: red"&gt;Action&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;Preview&lt;/span&gt;&amp;quot;
&lt;span style="color: red"&gt;Form&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;Microsoft.Exchange.Clients.Owa.Premium.Controls.CustomFormRedirectPreFormAction,Microsoft.Exchange.Clients.Owa&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;/&amp;gt;
        &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Mapping &lt;/span&gt;&lt;span style="color: red"&gt;Action&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;Reply&lt;/span&gt;&amp;quot;
&lt;span style="color: red"&gt;Form&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;Microsoft.Exchange.Clients.Owa.Premium.Controls.CustomFormRedirectPreFormAction,Microsoft.Exchange.Clients.Owa&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;/&amp;gt;
        &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Mapping &lt;/span&gt;&lt;span style="color: red"&gt;Action&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;ReplyAll&lt;/span&gt;&amp;quot;
&lt;span style="color: red"&gt;Form&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;Microsoft.Exchange.Clients.Owa.Premium.Controls.CustomFormRedirectPreFormAction,Microsoft.Exchange.Clients.Owa&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;/&amp;gt;
        &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Mapping &lt;/span&gt;&lt;span style="color: red"&gt;Action&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;Forward&lt;/span&gt;&amp;quot;
&lt;span style="color: red"&gt;Form&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;Microsoft.Exchange.Clients.Owa.Premium.Controls.CustomFormRedirectPreFormAction,Microsoft.Exchange.Clients.Owa&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;/&amp;gt;
        &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Mapping &lt;/span&gt;&lt;span style="color: red"&gt;Action&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;New&lt;/span&gt;&amp;quot;
&lt;span style="color: red"&gt;Form&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;Microsoft.Exchange.Clients.Owa.Premium.Controls.CustomFormRedirectPreFormAction,Microsoft.Exchange.Clients.Owa&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;/&amp;gt;
      &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;ElementClass&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
    &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;ApplicationElement&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
  &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Experience&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Registry&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
          &lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/tbody&gt;&lt;/table&gt;
&lt;/blockquote&gt;

&lt;p&gt;A few notes on the way that I implemented the above mappings.&amp;#160; The documentation states that multiple “actions” can be space-separated in the same mapping element.&amp;#160; I have not seen this work, so I set the mapping for each action in a separate tag.&amp;#160; I’d also note that the documentation has language that says that if either the Action or State values are omitted from a mapping tag then they will apply “unless a more specific mapping is specified”.&amp;#160; You should be aware that the more specific mapping &lt;em&gt;may &lt;/em&gt;be in the built-in registry files, so if you have a mapping that doesn’t seem to be working, you should try explicitly mapping actions and states that you’re trying to handle.&amp;#160; I’ve taken this approach in the above example.&lt;/p&gt;

&lt;p&gt;The &lt;em&gt;Registry.XML&lt;/em&gt; file can be placed in &lt;em&gt;C:\Program Files\Microsoft\Exchange Server\ClientAccess\Owa\forms\Customization\&lt;/em&gt; or any folder &lt;u&gt;directly under&lt;/u&gt; &lt;em&gt;C:\Program Files\Microsoft\Exchange Server\ClientAccess\Owa\forms\.&amp;#160; &lt;/em&gt;For this example, I’m placing the &lt;em&gt;Registry.XML&lt;/em&gt;, &lt;em&gt;ViewHelpTicket.ASPX&lt;/em&gt;, and &lt;em&gt;NewHelpTicket.ASPX&lt;/em&gt; all under &lt;em&gt;C:\Program Files\Microsoft\Exchange Server\ClientAccess\Owa\forms\HelpTicket\&lt;/em&gt;).&amp;#160; Also note that the form paths are relative to where the &lt;em&gt;Registry.xml &lt;/em&gt;file is located.&lt;/p&gt;

&lt;p&gt;OWA will not read in the new file until is it restarted, and depending on your environment, this may not happen without some action on your part.&amp;#160; To force the restart, you can run “iisreset /noforce” from a command line on the Exchange Client Access server where you are creating these files.&lt;/p&gt;

&lt;p&gt;If your file is read in successfully, you can find an event in the Windows Application Event Viewer that looks like the following: &lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/rickhall/WindowsLiveWriter/ExchangeServer2007SP1OutlookWebAcces.xml_CEBB/image_4.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/rickhall/WindowsLiveWriter/ExchangeServer2007SP1OutlookWebAcces.xml_CEBB/image_thumb_1.png" width="631" height="444" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;&lt;em&gt;(Source = MSExchange OWA, EventId = 73)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;If you have an error in your &lt;em&gt;Registry.XML&lt;/em&gt; file you’ll instead see an event like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/rickhall/WindowsLiveWriter/ExchangeServer2007SP1OutlookWebAcces.xml_CEBB/image_6.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/rickhall/WindowsLiveWriter/ExchangeServer2007SP1OutlookWebAcces.xml_CEBB/image_thumb_2.png" width="631" height="444" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;&lt;em&gt;(Source = MSExchange OWA, EventId = 9)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Event 9 will include a description of the parsing error, along with line numbers and position.&amp;#160; Note also that a bad Registry.XML file can leave OWA in a non-working state, since the mappings are merged into the same structures that handle the normal workings of OWA.&lt;/p&gt;

&lt;p&gt;In the next installment of this series, I’ll cover the &lt;em&gt;UIExtenstions.xml &lt;/em&gt;file, and how we’ll use that to enable users to create a new item with this custom type.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;MSDN Documentation:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Details of forms registry file (&lt;em&gt;registry.xml&lt;/em&gt;): &lt;a href="http://msdn.microsoft.com/en-us/library/bb891879.aspx"&gt;http://msdn.microsoft.com/en-us/library/bb891879.aspx&lt;/a&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9381822" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/rickhall/archive/tags/Exchange/default.aspx">Exchange</category><category domain="http://blogs.msdn.com/rickhall/archive/tags/DevMsgTeam/default.aspx">DevMsgTeam</category><category domain="http://blogs.msdn.com/rickhall/archive/tags/OWA/default.aspx">OWA</category></item><item><title>Where’s the MAPI Documentation?</title><link>http://blogs.msdn.com/rickhall/archive/2009/01/28/where-s-the-mapi-documentation.aspx</link><pubDate>Wed, 28 Jan 2009 18:38:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9381200</guid><dc:creator>Rick_H</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/rickhall/comments/9381200.aspx</comments><wfw:commentRss>http://blogs.msdn.com/rickhall/commentrss.aspx?PostID=9381200</wfw:commentRss><description>&lt;P&gt;Many of our customers are still using MAPI for programmatic access to Exchange mailboxes.&amp;nbsp; The documentation for MAPI was recently relocated on MSDN, so we’re trying to get the word out about where to start.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://msdn.microsoft.com/en-us/library/cc765775.aspx" target=_blank mce_href="http://msdn.microsoft.com/en-us/library/cc765775.aspx"&gt;MAPI Documentation on MSDN (http://msdn.microsoft.com/en-us/library/cc765775.aspx)&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;For more details on the change in content and organization, head over to the &lt;A href="http://blogs.msdn.com/officedevdocs/archive/2009/01/20/where-is-the-mapi-documentation.aspx" target=_blank mce_href="http://blogs.msdn.com/officedevdocs/archive/2009/01/20/where-is-the-mapi-documentation.aspx"&gt;Office Client Developer Content Blog&lt;/A&gt;.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9381200" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/rickhall/archive/tags/DevMsgTeam/default.aspx">DevMsgTeam</category><category domain="http://blogs.msdn.com/rickhall/archive/tags/MAPI/default.aspx">MAPI</category></item><item><title>Messaging Development at the PDC</title><link>http://blogs.msdn.com/rickhall/archive/2008/10/31/messaging-development-at-the-pdc.aspx</link><pubDate>Fri, 31 Oct 2008 02:54:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9025764</guid><dc:creator>Rick_H</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/rickhall/comments/9025764.aspx</comments><wfw:commentRss>http://blogs.msdn.com/rickhall/commentrss.aspx?PostID=9025764</wfw:commentRss><description>&lt;P&gt;If you were at the Professional Developer Conference in L.A. this week, then you're probably exhausted, suffering from a bit of information overload, and either on your way home or getting ready to head that way.&amp;nbsp; There was a ton of information on so many topics, and thankfully even if you weren't in L.A., you can still watch the sessions online.&lt;/P&gt;
&lt;P&gt;I wanted to call out a few sessions that might be of interest to Messaging Developers:&lt;/P&gt;
&lt;P&gt;&lt;A id=ctl00_MainPlaceHolder_TitleLink href="http://channel9.msdn.com/pdc2008/BB46/" mce_href="http://channel9.msdn.com/pdc2008/BB46/"&gt;Exchange Web Services Managed API: Unified Communications Development for Exchange &lt;/A&gt;- If you use EWS, are thinking about using EWS, or got scared away from EWS by terms like SOAP and WS-*, then you have to watch this session.&amp;nbsp; Jason Henderson lays out the details of a new managed API that will greatly simplify developing&amp;nbsp;code that integrates with&amp;nbsp;Exchange. &lt;/P&gt;
&lt;P&gt;&lt;A id=ctl00_MainPlaceHolder_TitleLink href="http://channel9.msdn.com/pdc2008/TL01/" mce_href="http://channel9.msdn.com/pdc2008/TL01/"&gt;Office Business Applications: Enhanced Deployment&lt;/A&gt;&amp;nbsp;- The title of this one doesn't capture all of the interesting topics that Saurabh covered.&amp;nbsp; In the process of covering the deployment scenario, he also hit on a lot of the changes that are coming to Office Business Application development (AKA: VSTO) in the next version of Visual Studio, including the removal of runtime dependencies on Primary Interop Assemblies (PIA's).&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;A id=ctl00_MainPlaceHolder_TitleLink href="http://channel9.msdn.com/pdc2008/BB09/" mce_href="http://channel9.msdn.com/pdc2008/BB09/"&gt;Microsoft Office Communications Server and Exchange: Platform Futures&lt;/A&gt;&amp;nbsp;- This session talked about the future of extensibility for Office Communications Server and&amp;nbsp;Office Communicator&amp;nbsp;as well as the UC functionality of Exchange Server.&lt;/P&gt;
&lt;P mce_keep="true"&gt;There's a ton of other great content available at:&amp;nbsp;&lt;A href="https://sessions.microsoftpdc.com/" mce_href="https://sessions.microsoftpdc.com/"&gt;https://sessions.microsoftpdc.com&lt;/A&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9025764" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/rickhall/archive/tags/DevMsgTeam/default.aspx">DevMsgTeam</category><category domain="http://blogs.msdn.com/rickhall/archive/tags/PDC08/default.aspx">PDC08</category></item><item><title>Outlook Web Access Custom Forms for Public Folder Items, ConvertId Fails</title><link>http://blogs.msdn.com/rickhall/archive/2008/09/29/outlook-web-access-custom-forms-for-public-folder-items-convertid-fails.aspx</link><pubDate>Mon, 29 Sep 2008 23:21:53 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8969441</guid><dc:creator>Rick_H</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/rickhall/comments/8969441.aspx</comments><wfw:commentRss>http://blogs.msdn.com/rickhall/commentrss.aspx?PostID=8969441</wfw:commentRss><description>&lt;p&gt;I have seen a few cases now where people are trying to implement custom forms for Public Folder Items under Outlook Web Access (Exchange 2007 Sp1, see &lt;a target="_blank" href="http://msdn.microsoft.com/en-us/library/bb891879.aspx"&gt;here&lt;/a&gt; for more details on this functionality).&lt;/p&gt;  &lt;p&gt;One problem arises when you run into an item that includes &amp;#8220;%2B&amp;#8221; in the value for the Id that is passed to the custom form on the Query String.&amp;#160; When you use the typical methods of retrieving the value of this field, such as retrieving the value from the QueryString collection that is a member of the System.Web.HttpRequest object, .NET helpfully UrlDecodes the value that is returned.&amp;#160; When you turn around and use this value to populate an AlternatePublicFolderItemIdType, which in turn is used to populate a ConvertIdType, which is then used to call ConvertId, you will receive an error indicating that the item could not be found.&lt;/p&gt;  &lt;p&gt;The simple solution for this issue is to UrlEncode the Id value before placing it into the AlternatePublicFolderItemIdType, like this:&amp;#160; &lt;/p&gt;  &lt;blockquote&gt;AlternatePublicFolderItemIdType id = new AlternatePublicFolderItemIdType();    &lt;br /&gt;id.Format = IdFormatType.OwaId;     &lt;br /&gt;id.ItemId = HttpUtility.UrlEncode(Request.QueryString[&amp;quot;Id&amp;quot;]);&lt;/blockquote&gt;  &lt;p&gt;One of my &lt;a target="_blank" href="http://blogs.msdn.com/pcreehan/"&gt;colleagues&lt;/a&gt; correctly pointed out that this round trip UrlDecode/UrlEncode could possibly return a different value than was originally on the raw query string, but I have not found any cases yet where this happens.&lt;/p&gt;  &lt;p&gt;A second nuance of this scenario is that the schema for the AlternatePublicFolderItemId Type requires a value for the FolderId field, but when the source type is IdFormatType.OwaId, this value is ignored. Simply populate this field with an empty string and it will pass schema validation.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8969441" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/rickhall/archive/tags/Exchange/default.aspx">Exchange</category><category domain="http://blogs.msdn.com/rickhall/archive/tags/DevMsgTeam/default.aspx">DevMsgTeam</category><category domain="http://blogs.msdn.com/rickhall/archive/tags/OWA/default.aspx">OWA</category></item><item><title>SMTP Sinks on Exchange Cluster</title><link>http://blogs.msdn.com/rickhall/archive/2008/02/25/smtp-sinks-on-exchange-cluster.aspx</link><pubDate>Mon, 25 Feb 2008 19:08:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7894276</guid><dc:creator>Rick_H</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/rickhall/comments/7894276.aspx</comments><wfw:commentRss>http://blogs.msdn.com/rickhall/commentrss.aspx?PostID=7894276</wfw:commentRss><description>&lt;FONT size=1&gt;
&lt;P&gt;In an Exchange cluster environment with multiple active nodes, Exchange instantiates one IIS virtual server (And therefore one SMTP Virtual Server Instance) for each external interface of the cluster.&amp;nbsp; This configuration is duplicated on each node of the cluster. &lt;/P&gt;
&lt;P&gt;For example, if you have an Active/Active/Passive cluster, then the external interfaces might map to the individual nodes like so:&lt;/P&gt;
&lt;P&gt;Ext.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Node&lt;BR&gt;-------------------------&lt;BR&gt;EXV1 -&amp;gt; Node1&lt;BR&gt;EXV2 -&amp;gt; Node2&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;Node3 (Passive)&lt;/P&gt;
&lt;P&gt;On each node, there will be two SMTP Virtual Server Instances (VSI), labeled EXV1 and EXV2.&amp;nbsp; Whenever a node becomes active, it starts the VSI that is associated with the external interface that is pointing to it.&amp;nbsp; So if Node1 fails, and Node3 takes over servicing EXV1, then Node3 will start up its EXV1 VSI.&amp;nbsp; Likewise if Node2 fails instead, Node3 will start its EXV2 VSI.&lt;/P&gt;
&lt;P&gt;Since each SMTP instance has its own event bindings, you must register bindings that apply to any SMTP VSI that could become active at any time. For a clustered Exchange setup this means that you should register the SMTP Sink on every SMTP VSI that exists on every box.&lt;/P&gt;
&lt;P&gt;Using the simple example in this &lt;A class="" href="http://support.microsoft.com/kb/317680" mce_href="http://support.microsoft.com/kb/317680"&gt;KB Article&lt;/A&gt; (How to add a disclaimer to outgoing SMTP messages in Visual Basic script), instead of registering with just this:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;cscript smtpreg.vbs /add 1 onarrival SMTPScriptingHost CDO.SS_SMTPOnArrivalSink "mail from=*@your-domain-here.com"&lt;BR&gt;cscript smtpreg.vbs /setprop 1 onarrival SMTPScriptingHost Sink ScriptName "C:\EventSinkScript.vbs"&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You would have to register additional bindings for all other instances (one for each active node).&amp;nbsp; So for our Active/Active/Passive cluster mentioned above, you would register the sink like this:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;cscript smtpreg.vbs /add 1 onarrival SMTPScriptingHost CDO.SS_SMTPOnArrivalSink "mail from=*@your-domain-here.com"&lt;BR&gt;cscript smtpreg.vbs /setprop 1 onarrival SMTPScriptingHost Sink ScriptName "C:\EventSinkScript.vbs"&lt;BR&gt;cscript smtpreg.vbs /add&amp;nbsp;2 onarrival SMTPScriptingHost CDO.SS_SMTPOnArrivalSink "mail from=*@your-domain-here.com&lt;/A&gt;"&lt;BR&gt;cscript smtpreg.vbs /setprop&amp;nbsp;2 onarrival SMTPScriptingHost Sink ScriptName "C:\EventSinkScript.vbs"&lt;BR&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P mce_keep="true"&gt;If you look&amp;nbsp;at the code in the SMTPREG.VBS file's "DisplaySinks" method you can see some hints on how to do this enumeration programmatically.&lt;/P&gt;&lt;/FONT&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=7894276" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/rickhall/archive/tags/Exchange/default.aspx">Exchange</category><category domain="http://blogs.msdn.com/rickhall/archive/tags/Sink/default.aspx">Sink</category><category domain="http://blogs.msdn.com/rickhall/archive/tags/Cluster/default.aspx">Cluster</category><category domain="http://blogs.msdn.com/rickhall/archive/tags/SMTP/default.aspx">SMTP</category><category domain="http://blogs.msdn.com/rickhall/archive/tags/DevMsgTeam/default.aspx">DevMsgTeam</category><category domain="http://blogs.msdn.com/rickhall/archive/tags/SMTPREG/default.aspx">SMTPREG</category></item><item><title>Introduction</title><link>http://blogs.msdn.com/rickhall/archive/2008/02/25/introduction.aspx</link><pubDate>Mon, 25 Feb 2008 18:58:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7894164</guid><dc:creator>Rick_H</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/rickhall/comments/7894164.aspx</comments><wfw:commentRss>http://blogs.msdn.com/rickhall/commentrss.aspx?PostID=7894164</wfw:commentRss><description>&lt;P&gt;I have another blog at &lt;A href="http://onemanshouting.com/"&gt;http://onemanshouting.com&lt;/A&gt; that I have maintained for several years with varying degrees of activity.&amp;nbsp; Since joining Microsoft I haven't&amp;nbsp;made a lot of time&amp;nbsp;for blogging, but I have started running into work-related topics that might make good blog fodder. I&amp;nbsp;decided to start this blog as a location to post information that might be useful to developers who are leveraging various Microsoft technologies in the messaging space.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=7894164" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/rickhall/archive/tags/Intro/default.aspx">Intro</category></item></channel></rss>