Generating OWA Url's for Mail Items and producing Summary Emails for Public Folders and Mailbox's with Powershell and the EWS Managed API
Its often useful to be able to create a link that will open a specific email within OWA for a variety of different uses (eg RSS feeds, Summary email, Calendar Summary pages etc). With EWS you can get the OWAid which is necessary to form an OWA URL that will be usable by using a covertid operation. Depending on whether you want to show items that are located in mailbox or public folder then you need to use one of two different objects when doing a covertid eg to convert Mailbox Items into the OWA format from a EWS Query $aiItem = New-Object Microsoft.Exchange.WebServices.Data.AlternateId $aiItem.Mailbox = "Blah@Blah.com" $aiItem.UniqueId = $Item.Id.UniqueId $aiItem.Format = [Microsoft.Exchange.WebServices.Data.IdFormat]::EwsId; $owaid = $service.ConvertId($aiItem, [Microsoft.Exchange.WebServices.Data.IdFormat]::OwaId) If its a public folder use the following $aiItem = New-Object Microsoft.Exchange.WebServices.Data.AlternatePublicFolderItemId $aiItem.FolderI