PowerShell 技能连载 - Retrieving Outlook Calendar Entries

If you use Outlook to organize your calendar events, here is a useful PowerShell function that connects to Outlook and dumps your calendar entries:

Function Get-OutlookCalendar
{
    # load the required .NET types
    Add-Type -AssemblyName 'Microsoft.Office.Interop.Outlook'

    # access 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 calendar items
    $folder.items |
      Select-Object -Property Start, Categories, Subject, IsRecurring, Organizer
}

Try this:

PS> Get-OutlookCalendar | Out-GridView

PowerShell 技能连载 - Retrieving Outlook Calendar Entries

http://blog.vichamp.com/2018/10/15/retrieving-outlook-calendar-entries/

作者

吴波

发布于

2018-10-15

更新于

2022-07-06

许可协议

评论