If you use Microsoft Outlook to organize your calendar events, PowerShell has a useful function that connects to your Microsoft Outlook and displays your calendar entries.
In this article I’ll will show you a how to use this handy PowerShell function. The function below connects to your Microsoft Outlook and displays your calendar entries. With Out-GridView parameter you can output the result to nice graphical window.
# Load the required .NET types
Add-Type -AssemblyName 'Microsoft.Office.Interop.Outlook'
# Access the Microsoft Outlook object model
$Outlook = New-Object -ComObject outlook.application
# Connect to the appropriate location
$Namespace = $Outlook.GetNameSpace('MAPI')
$Calendar = [Microsoft.Office.Interop.Outlook.OlDefaultFolders]::olFolderCalendar
$Folder = $Namespace.getDefaultFolder($Calendar)
# Get the calendar entries
$Folder.items | Select-Object -Property Start, Categories, Subject, IsRecurring, Organizer
Save the code above as a PowerShell module to C:\Program Files\WindowsPowerShell\Modules\Get-OutlookCalendarEntries\Get-OutlookCalendarEntries.psm1
Open a PowerShell console and type:
Get-OutlookCalendarEntries | Out-GridView
This will give you a nice output like:
In this article I have show you a handy PowerShell function that connects to your Microsoft Outlook and displays your calendar entries.
I really like to hear what you have to say about this article:
- Was this article helpful for you or do you have any questions?
- Do you have additions, suggestions or any other ideas?
- Just let me know by leaving a comment below.
Thank you for spending some time at my site and in my blog. I hope you come to visit again soon!