通过EWS为用户提供的时区和工作时间 [英] TimeZone and Working Hours for Users through EWS

查看:143
本文介绍了通过EWS为用户提供的时区和工作时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以通过EWS获得TimeZone和用户的工作时间?

Is it possible to get TimeZone and working hours of the users through EWS?

我能够提取当前用户的TZ和工作时间(初始化ExchangeService的帐户)

I am able to extract TZ and Working Hours for current user(Account with which the ExchangeService is initialized)

UserConfiguration usrConfig = UserConfiguration.Bind(service, "WorkHours", WellKnownFolderName.Calendar, UserConfigurationProperties.All);

XmlDocument xmlDoc = new XmlDocument();
xmlDoc.Load(new MemoryStream(usrConfig.XmlData));
XmlNodeList nlList = xmlDoc.GetElementsByTagName("WorkHoursVersion1");
Console.WriteLine(nlList.Item(0).InnerXml);
string str = nlList.Item(0).InnerXml;

但是我无法为其他用户提取相同的信息.

But I am not able to extract the same information for other users.

推荐答案

我使用输入是一组用户.输出包括

Input is an array of users. Output includes an array of AttendeeAvailability, which contains a WorkingHours property, which itself includes TimeZone:

GetUserAvailabilityResults uars = service.GetUserAvailability(
    new AttendeeInfo[] { new AttendeeInfo(smtpAddressOfUser, MeetingAttendeeType.Required, true), ... }, 
    new TimeWindow(DateTime.Now, DateTime.Now.AddDays(1)), 
    AvailabilityData.FreeBusy
    );

这篇关于通过EWS为用户提供的时区和工作时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆