在资源日历中访问会议的原始主题

发布于 2024-07-07 18:37:33 字数 1478 浏览 3 评论 0原文

我正在尝试设置一个系统,使用 Exchange 2007 和 EWS(Exchange Web 服务)在网页上显示资源日历中的日历项目。

我已设法访问资源的日历,但在获取日历中的项目时,每个日历项目的主题不是某人创建会议请求并邀请资源时使用的原始主题,而是用户名在创建会议请求的帐户上,例如。 如果我执行以下操作:

List<CalendarItemType> items = 
    Calendar.GetCalendarItems("[email protected]", 
                              Calendar.GetNextWeekView(), 
                              binding);
if (items.Count > 0)
{
    Console.WriteLine(string.Format("Calendar opened - fetched {0} items",
                                    items.Count));
    Console.WriteLine("===================================");
    foreach (var item in items)
    {
        Console.WriteLine();
        Console.WriteLine(item.Subject);
        Console.WriteLine("----------------------------------------");
        Console.WriteLine("\tOrganizer: " + item.Organizer.Item.Name);
        Console.WriteLine();
        Console.WriteLine("\tStart:     " + item.Start.ToString("dd-MM-yyyy HH:mm"));
        Console.WriteLine("\tSlut:      " + item.Start.ToString("dd-MM-yyyy HH:mm"));
    }
}

其中 Calendar.GetCalendarItems 是一种获取第一个参数表示的资源的日历项目的方法,Calendar.GetNextWeekView() 是一个静态方法,它创建一个跨越今天日期下周的 CalendarView,并且绑定设置为使用具有资源邮箱委托访问权限的帐户。

如果使用管理员帐户预订资源,则 item.Subject 将显示为管理员。

有谁知道如何解决这个问题 - 我是否需要进行某种特殊的属性访问,或者获取其他类型的项目或什么?

问候 杰斯帕·豪格

I'm trying to set up a system that displays calendar items from a resource calendar on a web page using Exchange 2007 and EWS (Exchange Web Services).

I've managed to get access to the calendars of the resources, but when getting the items in the calendars, the subject of each calendar item is not the original subject used when someone created the meeting request and invited the resource, but rather the Username on the account that created the the meeting request eg. if I do something like:

List<CalendarItemType> items = 
    Calendar.GetCalendarItems("[email protected]", 
                              Calendar.GetNextWeekView(), 
                              binding);
if (items.Count > 0)
{
    Console.WriteLine(string.Format("Calendar opened - fetched {0} items",
                                    items.Count));
    Console.WriteLine("===================================");
    foreach (var item in items)
    {
        Console.WriteLine();
        Console.WriteLine(item.Subject);
        Console.WriteLine("----------------------------------------");
        Console.WriteLine("\tOrganizer: " + item.Organizer.Item.Name);
        Console.WriteLine();
        Console.WriteLine("\tStart:     " + item.Start.ToString("dd-MM-yyyy HH:mm"));
        Console.WriteLine("\tSlut:      " + item.Start.ToString("dd-MM-yyyy HH:mm"));
    }
}

Where Calendar.GetCalendarItems, is a method that fetches the calendar items of the resource denoted by the first argument, the Calendar.GetNextWeekView() is a static method that creates a CalendarView spanning the next week from today's date, and the binding is set up to use an account with delegate access to the resource mailbox.

The item.Subject comes out as Administrator if the Administrator account was used to book the resource.

Does anyone know how to remedy this - do I need to make some kind of special property access, or fetch another type of item or what?

Regards
Jesper Hauge

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

放手` 2024-07-14 18:37:33

当我开始查看代码之外时,就弄清楚了这一点。

答案在于资源配置而不是访问代码。

如果你想让会议的主题反映原来的主题。 确保资源已将设置属性 DeleteSubjectAddOrganizerToSubject 设置为 false。 可以使用以下 shell 命令来实现:

Set-MailboxCalendarSettings resourcename -DeleteSubject 0 -AddOrganizerToSubject 0

问候
杰斯帕·豪格

Figured this one out - when I started looking outside the code.

Answer lies in resource configuration rather than access code.

If you want to have the subject of the meeting reflect the original subject. Make sure the resource has set the setting properties DeleteSubject and AddOrganizerToSubject to false. It can be achieved with the following shell command:

Set-MailboxCalendarSettings resourcename -DeleteSubject 0 -AddOrganizerToSubject 0

Regards
Jesper Hauge

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文