gpt4 book ai didi

powershell - 使用 EWS PowerShell 获取共享交换日历

转载 作者:行者123 更新时间:2023-12-03 16:42:08 25 4
gpt4 key购买 nike

如何使用 EWS 或 EWS 托管 API 从 Exchange 访问共享日历?我需要能够从中读取项目。

最佳答案

也许可以从什么开始?

# Your mailbox here
$mailboxName = "blah@blih.com"

Add-Type -Path "C:\Program Files\Microsoft\Exchange\Web Services\2.0\Microsoft.Exchange.WebServices.dll"
$version = [Microsoft.Exchange.WebServices.Data.ExchangeVersion]::Exchange2010_SP2
$service = new-object Microsoft.Exchange.WebServices.Data.ExchangeService($version)
$service.UseDefaultCredentials = $true
$service.AutodiscoverUrl($mailboxName)

$folderid = new-object Microsoft.Exchange.WebServices.Data.FolderId([Microsoft.Exchange.WebServices.Data.WellKnownFolderName]::Calendar, $mailboxName)
$calendarFolder = [Microsoft.Exchange.WebServices.Data.calendarFolder]::Bind($service, $folderid)
$calendarView = new-object Microsoft.Exchange.WebServices.Data.CalendarView([System.DateTime]::Now, [System.DateTime]::Now.AddDays(720))
$calendarView.MaxItemsReturned = 200;
$calendarView.PropertySet = new-object Microsoft.Exchange.WebServices.Data.PropertySet([Microsoft.Exchange.WebServices.Data.BasePropertySet]::FirstClassProperties)
$result = $calendarFolder.FindAppointments($calendarView)

$result | Format-Table

关于powershell - 使用 EWS PowerShell 获取共享交换日历,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14934486/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com