Quickstep's in Outlook is a feature that was added in Outlook in 2010 to help automate repetitive tasks you do with Email in Outlook. In this Post I'm going to go through how you can manipulate the objects associated with Quick steps using EWS and PowerShell.
How Quick Steps are implemented in a Mailbox
The OuickSteps Folder is created by Outlook (eg no Outlook no folder) In the Mailbox's IPM Root as a hidden folder called Quick Steps (with a FolderClass of IPF.Configuration) and within this folder there are FAI (Folder Associated Items) which represent each of the QuickStep Items. On each of those there is a PidTagRoamingXmlStream property which contains a ByteArray that represents an XMLDocument for each of the QuickStep items for example they look something like
Getting the QuickSteps Folder
To Get the QuickSteps folder (if it exists) you can use the PidTagAdditionalRenEntryIdsEx property on the IPM Root folder which will contain the HexEntryId of the QuickSteps folder in the RSF_PID_COMBINED_ACTIONS PersistBlockType value. Eg you can do this using the following code
Getting the Quick Steps Items
The Quick Step items are stored in the Folder Associated Items collection of the Quick Steps folder. To get these using EWS after you get the Quick Steps folder you just need to enumerate the items in the FAI collection by specifying an Associated Items traversal. eg the following code will return the existing Quick Step items
Export QuickStep XML
To Export the XML from a Quick Step Item you can grab the PR_Roaming_XMLStream property and then save this out to a file (it just plain XML) eg
Creating a QuickStep from XML (Unsupported)
Note creating Quicksteps using anything other then Outlook should be considered unsupported so if you use this make sure you do your own testing. Creating a QuickStep from the XML is just a matter of creating an Item and setting the PR_Roaming_XMLStream property with the appropriate XML from the item. The following cmdlet first reads the existing Quicksteps to ensure your creating a Quickstep with the same name as an existing one. eg
I've put all these samples into a QuickSteps EWS module which you can download from here some examples of what you can do with this
to Get the QuickSteps folder
Get-QuickStepsFolder -MailboxName email@example.com
To Get the existing Quick Steps
Get-QuickSteps -MailboxName firstname.lastname@example.org
This returns a HashTable of the QuickSteps to access a Quickstep within the collection use the Index value eg
$QuickSteps = Get-QuickSteps -MailboxName email@example.com
To Delete and existing QuickStep
Delete-QuickStep -MailboxName firstname.lastname@example.org -Name 'Task Name'
This cmdlet will search for a quickstep based on the Name attribute in the QuickSteps XML document if one is found it will prompt if you want to delete it.