EWS Script to automatically generate registry keys to enable Custom Forms in Outlook

As you know Custom form script is now disabled by default and you will need to create a set of registry keys as outlined in this KB. We have had a few customers who have a lot of custom forms published in the Organizational Forms Library and it can be painful to get the message…


Using–Filter, Select-Object, ForEach-Object in C# – Exchange PowerShell Automation

Have you ever tried migrating Exchange PowerShell script to be used from C# code?  I needed to convert the following script to C# Get-Mailbox -filter {ResourceType -ne "Room"}| Select-object Alias,DistinguishedName,Identity | foreach-object {Get-MailboxFolderStatistics $_.Alias} If you run the above script in Exchange 2010 Management Shell you might get the following error message: Pipeline not executed…


Searching contacts using EWS Managed API 1.1 from PowerShell (Impersonation, SearchFilterCollection, ContainsSubstring)

Here is another example of using EWS Managed API with PowerShell 2.0. In this case the requirement was to be able to find out all contacts that have Hotmail email address in any of the Email Address fields. This provided me to opportunity to demonstrate the use SearchFilterCollection and ContainsSubstring search filter from a PowerShell…


HOW TO: Migrating Exchange 2007 PowerShell Managed code to work with Exchange 2010

Will my Exchange 2007 PowerShell Managed code work with Exchange 2010 as is? Unfortunately the answer is NO, fortunately there are not many changes that you will have to make. The management experience given by Exchange 2010 through PowerShell has been moved all the way from Local to Remote. Dave Vespa has a detailed post…


HOW TO: Configure Exchange 2007 and Exchange 2010 for using Impersonation

Exchange 2010: Configuring Exchange Impersonation (Exchange Web Services) http://msdn.microsoft.com/en-us/library/bb204095.aspx Using Exchange Impersonation XML Request/Response http://msdn.microsoft.com/en-us/library/bb204088.aspx Using Impersonation in EWS Managed API http://msdn.microsoft.com/en-us/library/dd633680(EXCHG.80).aspx Exchange 2007: Configuring Exchange Impersonation (Exchange Web Services) http://msdn.microsoft.com/en-us/library/bb204095(EXCHG.80).aspx Using Exchange Impersonation (Exchange Web Services) http://msdn.microsoft.com/en-us/library/bb204088(EXCHG.80).aspx ExchangeServiceBinding Class – Code Sample http://msdn.microsoft.com/en-us/library/exchangewebservices.exchangeservicebinding.aspx Enjoy!


HOW TO:Using Exchange Web Services Managed API 1.0 from PowerShell 2.0

Requirement: Setting the OOF setting for a user using PowerShell Script. The best and the easiest option I could think of was to use the Exchange Web Services Managed API 1.0 from with PowerShell 2.0. I finally got it to work! # The script requires the EWS managed API, which can be downloaded here:# http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=c3342fb3-fbcc-4127-becf-872c746840e1#…


HOWTO: Using PowerShell in ASP.NET (.NET Framework 2.0)

The easiest solution is to create a COM component and register that component with component services (COM+) running the component under a specific user identity. Why do I say this? Read on… In my case the Web site/Application was configured to run under the DefaultAppPool (Identity = Network Service) and you I wanted to use…


HOW TO: Using WebDAV from PowerShell 1.0

I was just trying my hands on PowerShell and wanted to try using WebDAV from it. I wrote a small sample that searches the inbox of a user for unread mails and lists out the Href and the Subject of the email. Create a .PS1 file as below: #Change the Server name and Credentials [System.String]$serverName…


HOW TO: Add SMTP ProxyAddresses to a mailbox using Exchange PowerShell and Managed code.

The key here is that you will first have to read all the proxy addresses using the Get-Mailbox Cmdlet and then call the Set-mailbox Cmdlet to update the ProxyAddresses. If this is not done you end up replacing all the existing addresses with the one you just added. To get the sample to work you…