【发布时间】:2021-02-01 16:22:59
【问题描述】:
我已经在Asp.net C # 中使用 Exchange WebServices (EWS) 一段时间了,以便在我工作的 Office365 用户的日历中添加事件。
我现在需要这些相同的事件出现在 Microsoft Teams 中,并有可能进行视频会议。
事件出现了,但这种可能性不存在。
“appointments”的属性之一是“isOnlineMeeting”。我尝试添加它,使其成为true,但它总是返回一个错误,提示“设置操作对属性无效。”。
在我做的在线搜索中,我发现这是一个只读属性。
那么,我有没有机会“强制”这个属性?
我已经对我的 Exchange 进行了配置,因此,在 Outlook Online 中,当我们进行新活动时,总是通过视频会议进行。
一些帮助?
谢谢!
更新: 顺便说一句,我正在使用的代码是:
try {
ExchangeService service = new ExchangeService (ExchangeVersion.Exchange2013_SP1, TimeZoneInfo.FindSystemTimeZoneById ("GMT Standard Time"));
service.Url = new Uri ("https://outlook.office365.com/EWS/Exchange.asmx");
string User = "a@a.net";
string Password = "AAA";
service.Credentials = new NetworkCredential (User, Password);
Appointment appointment = new Appointment (service);
appointment.Subject = "Experiment";
appointment.Location = "Videoconference";
string dataStart = "10-02-2021 19:00:00.000";
string dataEnd = "10-02-2021 20:00:00.000";
appointment.Start = DateTime.Parse (dataStart);
appointment.End = DateTime.Parse (dataEnd);
appointment.Body = "<strong>Ignore! Just a test</strong>";
appointment.IsOnlineMeeting = true;
appointment.RequiredAttendees.Add ("b@a.net");
appointment.Save (SendInvitationsMode.SendOnlyToAll);
} catch (Exception ex) {
}
【问题讨论】:
-
Documentation 谈到您可以获取/设置它的值。你在说它吗?
-
@user3330412:我同意开发人员的回答。您可以设置“isOnlineMeeting”属性。请尝试使用最新的 SDK 来查看所需的更改。
-
很抱歉我花了这么长时间才回答...我已经安装了 EWS 2.2 版。即便如此,我也不允许更改该属性的值。我收到相同的错误消息。如果我注释这行代码,则没有问题,并且安排了活动。它只是没有出现在 Microsoft Teams 中,即参与视频会议的按钮。如果您从 Oulook 在线安排活动,则会出现此按钮。仅通过 EWS 以编程方式不会出现...谢谢!
-
您能否通过使用 Graph API 尝试使用此 document。通过使用 Graph API,我们可以将“isOnlineMeeting”属性设置为 true,将“onlineMeetingProvider”属性设置为“teamsForBusiness”。
标签: c# asp.net exchangewebservices microsoft-teams