EMEA Developer Support for Messaging Team Blog

Messaging Developer code samples and documentation

Browse by Tags

Tagged Content List
  • Blog Post: Exchange: Automating a Welcome Email to New Users

    Since Exchange 2010, it has been possible to use Scripting Agents to perform additional checks/processing when certain cmdlets are run. This feature can be used to automatically send an email to welcome new users. An overview of scripting agents and how they work can be found on Technet . To send...
  • Blog Post: PowerShell: Setting the global reading pane view in OWA

    Attached is a script that can be used to update the global reading pane view for OWA, and can be run against multiple mailboxes from PowerShell. It requires the EWS Managed API to be installed on the client machine, and if running against multiple mailboxes you'll need to grant impersonation rights to...
  • Blog Post: How to clear SIDHistory and keep mailbox permissions

    The SIDHistory attribute of a user object is used to store old SIDs for that user (usually SIDs from other domains when the user is migrated). In some cases, over time, this attribute can hold lots of values (every time a user is migrated, the previous SID is added to the list), and we sometimes get...
  • Blog Post: PowerShell: Clean Mailbox Delegates (update)

    I wrote a script a while ago that can remove invalid delegates from a mailbox using a mixture of EWS and Exchange PowerShell. The limitation of the original script is that is didn't do anything about the hidden rules that forward messages to delegates, which means that the unexpected NDR issue (as described...
  • Blog Post: PowerShell Automation from .Net

    Even though this blog has numerous PowerShell scripts showing mainly how to use EWS from PowerShell, scripting isn't actually something my team supports (Exchange scripting support is provided by the Exchange team). What we do support, though, is automation of PowerShell from .Net. We've had a couple...
  • Blog Post: PowerShell: Create folders in users' mailboxes

    Here is a PowerShell EWS script that will create folders (one or more) in users' mailboxes. To run it against a single mailbox, syntax is: .\Create-Folders.ps1 user1.ex2k7@hybrid.local "Folder 1;Folder 2" By default, folders are created under the inbox. For multiple folders (as above), separate...
  • Blog Post: PowerShell: Clean AD Users' ACL

    While this isn't strictly Messaging Development, this script is loosely related to a previous script that validates mailbox delegate permissions (by removing references to non-existent accounts). The same issue that applies to delegates applies to users. If a user has certain permissions on another account...
  • Blog Post: PowerShell: Purge folder of items over a certain age

    This PowerShell script can be used to purge a folder of its contents, optionally only deleting items before a certain date. Example usage: .\Purge-MailboxFolder user1.ex2k10@hybrid.local "Test Folder" "02/Aug/2013" -Impersonate -SearchForFolder The above will search for the first folder called...
  • Blog Post: PowerShell: Search public folders for items of a particular message class (ItemClass)

    In addition to the mailbox search script , I have also written a sample script showing how to do the same search against public folders. It works in exactly the same way, but iterates public folder tree instead of the mailbox. The EWS Managed API needs to be installed on the machine running the script...
  • Blog Post: PowerShell: Search mailbox for items of a particular message class (ItemClass)

    The Search-Mailbox cmdlet can be used to perform various searches within a mailbox, and while it serves many needs, there are some searches that it can't do. I wrote a PowerShell script to demonstrate how to perform a search of a mailbox (or mailboxes) using EWS, in this case looking for items of a particular...
  • Blog Post: PowerShell: Set Calendar folder delegate permissions in Exchange 2007

    Exchange 2010 has cmdlets ( Add-MailboxFolderPermission , Set-MailboxFolderPermission ) that allow an administrator to update folder permissions on a user's calendar. Unfortunately, Exchange 2007 does not have these cmdlets. We recently had a case that required updating many mailboxes (in this case resource...
  • Blog Post: PowerShell: Clean mailbox delegates

    An updated version of this script (that also handles the hidden forwarding rule) is available here: http://blogs.msdn.com/b/emeamsgdev/archive/2014/05/16/powershell-clean-mailbox-delegates-update.aspx Granting delegate access to a mailbox stores the permission on the mailbox to which the permission...
  • Blog Post: Outlook Code: Importing bank holidays from an Outlook.hol based CSV file

    We have been getting a few requests for code to automate the import of bank holidays in Outlook and prevent duplication. The easiest way to achieve this was to actually use the updated Outlook.hol file containing bank holiday definitions that Outlook uses when using the holiday import wizard. I have...
  • Blog Post: PowerShell: Remove invalid delegates from mailboxes

    We recently had a case where there were invalid delegates on a mailbox and these were causing further issues (which aren't important with regards to this blog!). Invalid delegates can come about when mailboxes and users are deleted from an organisation. The reason for this is that delegate permissions...
  • Blog Post: Office 365 Delegate Management

    While a lot of Office 365 administration can be done from the web interface, there are still a fair number of things that require PowerShell. One of these things is delegate management (though this is something that can also be handled via Outlook, but not OWA). I wrote a small application the allows...
  • Blog Post: PowerShell: Script to set holiday status to busy (or OOF, free, etc.)

    As you may or may not know, Outlook has a facility to import known public holidays. However, currently while these holidays will be imported into the Outlook calendar, the status of these holidays is set to Free. An often received request is for advice on how to change this status to Busy, or OOF. If...
  • Blog Post: PowerShell: Script to move items from one folder to another in a user's mailbox

    Manipulation of mailbox items is not something that is really available using Exchange cmdlets - understandably, as Exchange PowerShell is for administration of the Exchange environment rather than manipulation of mailboxes themselves. Of course, PowerShell itself offers all the features needed to be...
  • Blog Post: PowerShell: Script to recover all deleted items in a mailbox

    We had a request recently for a sample PowerShell script that shows how to recover deleted items from and Exchange 2010 mailbox. While not possible (as far as I am aware) using any standard Exchange cmdlets, it is certainly possible using the EWS Managed API. The script has been written so that it...
  • Blog Post: PowerShell: Script to import calendar items into Exchange mailbox from CSV file

    A recent case brought up the question of whether it is possible to import calendar items into a mailbox from a text file using PowerShell. While there aren't any cmdlets built-in that support this, it is certainly possible to implement this using PowerShell and the EWS Managed API. Sample script is attached...
  • Blog Post: EmailAddresses displayed as strings when connecting using the New-PSSession command

    When connecting using the Exchange Management Shell , the command (Get-Mailbox –Identity Administrator).EmailAddresses displays a result similar to: AddressString : C=GB;A= ;P=ZONE LTD;O=Exchange;S=Administrator;G=Zone; ProxyAddressString : X400:C=GB;A= ;P=ZONE LTD;O=Exchange;S=Administrator;G...
Page 1 of 1 (20 items)