1

私はEWS Managed APIと仕事をして会議室リストを取得しようとしています.と各室で1週間の予約リストを見ることができます。C#exchange server会議室の予約リストを取得

私は最初のリンクをテストしてきたと私は0部屋を取得Get room lists by using EWS in Exchange そしてGet appointments and meetings by using EWS in Exchange

を見ました。
また、2番目のリンクでは、現在のユーザーのカレンダーは表示されましたが、会議は行われませんでした。

1)自分の組織内の会議室のリストを取得します:

は、私は3つの事を必要としています。
2)各部屋のミーティングカレンダーを取得します(X日間)。
3)会議ごとに、誰が会議を構成しますか。

この情報を取得するためのAPIが見つかりません。 )

string filter = "(&(objectClass=*)(msExchRecipientDisplayType=7))"; 
//Assembly System.DirectoryServices.dll 
DirectorySearcher search = new DirectorySearcher(filter); 
List<AttendeeInfo> rooms = new List<AttendeeInfo>(); 
foreach (SearchResult result in search.FindAll()) 
      { 
       ResultPropertyCollection r = result.Properties; 
       DirectoryEntry entry = result.GetDirectoryEntry(); 
       // entry.Properties["displayName"].Value.ToString() will bring the room name 
       rooms.Add(new AttendeeInfo(entry.Properties["mail"].Value.ToString().Trim()));     
      } 

2:

答えて

0

は、検索やthis post のおかげで多くの後、私は、組織内のすべての会議室を取得するための#1と#2

1)質問に対する回答を見つけました

List<AttendeeInfo> attend = new List<AttendeeInfo>(); 
foreach (AttendeeInfo inf in rooms) 
    { 
     attend.Clear(); 
     attend.Add(inf.SmtpAddress); 

     AvailabilityOptions options = new AvailabilityOptions(); 
     options.MaximumSuggestionsPerDay = 48; 
     // service is ExchangeService object contains your authentication with exchange server 
     GetUserAvailabilityResults results = service.GetUserAvailability(attend, new TimeWindow(DateTime.Now, DateTime.Now.AddDays(2)), AvailabilityData.FreeBusyAndSuggestions, options); 

     foreach (AttendeeAvailability attendeeAvailability in results.AttendeesAvailability) 
       { 
        Console.WriteLine(); 
        Console.WriteLine(); 
        if (attendeeAvailability.ErrorCode == ServiceError.NoError) 
        { 
         foreach (Microsoft.Exchange.WebServices.Data.CalendarEvent calendarEvent in 
         attendeeAvailability.CalendarEvents) 
         { 
          Console.WriteLine("Calendar event"); 
          Console.WriteLine(" Starttime: " + calendarEvent.StartTime.ToString()); 
          Console.WriteLine(" Endtime: " + calendarEvent.EndTime.ToString()); 
          if (calendarEvent.Details != null) 
          { 
           Console.WriteLine(" Subject:" + calendarEvent.Details.Subject); 

          } 
         } 
        } 
       } 
      } 

質問3については、この情報を取得するのは簡単ではありません。通常のユーザーとして、あなたはそれを見る許可を持っていません。

関連する問題