Outlook Manipulation
Outlook Manipulation

First get connected to your running Outlook as an object

$marshal = [System.Runtime.InteropServices.Marshal]
$app = $marshal::GetActiveObject('Outlook.Application')

Now this $app is the outlook object
You can type $app to see the object and if you type $app | get-member you will see it's properties and methods

Let's say you want to create a new PST file in your Outlook:

$explorer = $app.ActiveExplorer()
$ns = $explorer.Session
$ns.AddStore('C:\Users\joedoe\Outlook\2012-Februari.pst')
if ($explorer.Session.Folders.Item('Outlook Data File')) { 
$pst= $explorer.Session.Folders.Item('Outlook Data File')
$pst.name = '2012-Februari'
                                                                          }

On Me

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License