Category Archives: Outlook

Create a calendar item

Continuing the occasional look at Outlook automation its time to see how we create a calendar item function new-calendaritem { param ( [string]$mailbox, [datetime]$start, [datetime]$end, [string]$subject, [string]$location, [string]$body ) $outlook = New-Object -ComObject Outlook.Application $folder = get-mailfolders | where {$_.Path … Continue reading

Posted in COM, Networking, Outlook, PowerShell V2 | 5 Comments

Outlook: removing calendar entries

We recently looked at dumping the Calendar entries http://msmvps.com/blogs/richardsiddaway/archive/2011/08/23/outlook-viewing-calendar-entries.aspx   I usually leave entries to build up in the Calendar but a simple clean operation is to delete everything that occurred before a certain date function remove-calendaritem { param ( … Continue reading

Posted in Office 2010, Outlook | Leave a comment

Outlook: Viewing Calendar Entries

We have seen how to view emails – this is how to view items in your calendar function get-calendaritem { $outlook = New-Object -ComObject Outlook.Application get-mailfolders | where {$_.Path -like “*calendar*” -and $_.Path -notlike “*birthday*”} | foreach { $targetfolder = … Continue reading

Posted in Office 2010, Outlook | Leave a comment

Outlook: sending emails

We’ve looked at examining the email folders and their contents, as well as cleaning out old emails. Its time to look at sending emails. This function shows the skeleton of the process function send-mailitem { param ( [string]$to, [string]$from, [string]$subject, … Continue reading

Posted in Office 2010, Outlook | Leave a comment

Outlook: deleting mail items

As promised here is the function to delete mail items in a specific folder function remove-mailitem { [CmdletBinding(SupportsShouldProcess=$true)] param ( [parameter(Mandatory=$true)] [string]$mailfolder, [datetime]$start, [datetime]$finish ) if ($start -and $finish){ if ($start -ge $finish){Throw “Finish $($finish) before Start $($start)”} } $outlook … Continue reading

Posted in Office 2010, Outlook, PowerShell V2, Windows 7 | 1 Comment

Outlook: Viewing mail items

Continuing our perambulation around Outlook when used with multiple hotmail accounts its time to look at the other folders and the mail items they contain. This post will show how to view the mail items and a future post will … Continue reading

Posted in Office 2010, Outlook, PowerShell V2, Windows 7 | Leave a comment

Clearing junk mail

Getting back to looking at working with Outlook we can adapt the function used to deleted the contents of the Deleted Items folder to work with the Junk mail folders function clear-junkmail { $outlook = New-Object -ComObject Outlook.Application get-mailitemcount -junk … Continue reading

Posted in Office 2010, Outlook, PowerShell V2, Windows 7 | Leave a comment