Calendar Can';没有邮箱,无法从Exchange for帐户获取约会

Calendar Can';没有邮箱,无法从Exchange for帐户获取约会,calendar,exchange-server,Calendar,Exchange Server,我有一小段代码连接到Exchange以获取特定帐户的约会。此帐户没有邮箱 Dim service As New ExchangeService(ExchangeVersion.Exchange2010_SP2) service.Credentials = New NetworkCredential("userID", "password") service.AutodiscoverUrl("me@work.com") Dim calView As New CalendarView(Dat

我有一小段代码连接到Exchange以获取特定帐户的约会。此帐户没有邮箱

Dim service As New ExchangeService(ExchangeVersion.Exchange2010_SP2)
service.Credentials = New NetworkCredential("userID", "password")
service.AutodiscoverUrl("me@work.com")   

Dim calView As New CalendarView(DateTime.Today, DateTime.Today.AddYears(2))
calView.Traversal = ItemTraversal.Shallow
calView.PropertySet = New PropertySet(BasePropertySet.FirstClassProperties, ItemSchema.Subject, AppointmentSchema.Location)

Dim mtgs As FindItemsResults(Of Item) = service.FindItems(WellKnownFolderName.Calendar, calView)
代码在最后一行引发以下异常

当以没有邮箱的帐户进行请求时,必须为任何可分辨文件夹ID指定邮箱主SMTP地址


我用service.UseDefaultCredentials=True来代替凭证行运行代码,它会执行,但当然会带回我的约会。有解决办法吗?我认为我的替代方案是说服Exchange管理员为感兴趣的帐户授予我的帐户模拟权限。

我发现了错误。此帐户有权访问某些会议室的日程安排,但没有自己的邮箱(或日历)。因此FindItems行不应使用“WellKnowFolderName.Calendar”,这将是帐户的日历。相反,它应该使用一个新的FolderID对象来指定要搜索的会议室的日历文件夹

Dim _cal As New FolderId(WellKnownFolderName.Calendar, New Microsoft.Exchange.WebServices.Data.Mailbox(room))

我发现了我的错误。此帐户有权访问某些会议室的日程安排,但没有自己的邮箱(或日历)。因此FindItems行不应使用“WellKnowFolderName.Calendar”,这将是帐户的日历。相反,它应该使用一个新的FolderID对象来指定要搜索的会议室的日历文件夹

Dim _cal As New FolderId(WellKnownFolderName.Calendar, New Microsoft.Exchange.WebServices.Data.Mailbox(room))

考虑一下你的答案,作为一个答案。它会帮助其他用户。考虑把你的答案作为答案。它将帮助其他用户。