2014-01-15 6 views
0

의 모임 만 표시하면 모든 사용자의 일정 (모두 메일 그룹에 있음)을 검색하고 해당 주최자 인 모임 만 표시 할 수 있습니까?사용자가 주최자 인 EWS

저는 가장을 사용하고 있습니다. 다음 코드와

나는 회의의 주최자를 얻을 수 있습니다 :

 //Instantiate the ExchangeService class+ Exchange Certificate Validation + Imparsonate 
     ServicePointManager.ServerCertificateValidationCallback = CertificateValidationCallBack; 
     ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2010_SP2); 
     service.Credentials = new NetworkCredential("user", "password", "domain"); 
     service.AutodiscoverUrl("[email protected]", RedirectionUrlValidationCallback); 

     //Distinguish Distribution Group 
     string distributiongroup = "[email protected]"; 

     // Initialize values for the start and end time. 
     DateTime startDate = DateTime.Now.AddMinutes(0); 
     DateTime endDate = startDate.AddDays(1); 

     //Extend the distribution group 
     ExpandGroupResults distGroupMembers = service.ExpandGroup(distributiongroup); 
     foreach (EmailAddress address in distGroupMembers.Members) 
     { 
      //Impersonate each distribution group member 
      service.ImpersonatedUserId = new ImpersonatedUserId(ConnectingIdType.SmtpAddress, address.Address); 

      // Execute the search in the calendar folder and return the view 
      CalendarView caledarView = new CalendarView(startDate, endDate); 
      caledarView.PropertySet = new PropertySet(BasePropertySet.FirstClassProperties); 
      FindItemsResults<Appointment> apt = service.FindAppointments(WellKnownFolderName.Calendar, caledarView); 

      foreach (Item item in apt.Items) 
      { 
       ServiceResponseCollection<GetItemResponse> myColl = service.BindToItems(new[] { new ItemId(item.Id.UniqueId) }, caledarView.PropertySet); 
       foreach (GetItemResponse temp in myColl) 
       { 
        Appointment app = (Appointment)temp.Item; 

        string organizator = app.Organizer.Address; 

        Console.WriteLine(address + "\n" + app.Subject + " " + organizator); 
       } 
      } 

내 목표는 자신이 이끌이 모든 사용자 만 회의를 얻는 것입니다.

이 문제에 대해 도와 줄 수 있습니까?

친절 감사 Xristos

+0

이 문제에 관한 문제/질문은 무엇입니까? – Marshall777

+0

사용자가 주최자 인 약속 만 나열하고 싶습니다. – user3197311

+0

Appointment 개체가 포함 된 목록을 작성한 다음 LINQ 쿼리를 사용하여 실제로 해결책이 아니라고 인정하더라도 원하는 약속 만 얻을 수 있습니다. – Marshall777

답변

0
if (organizator == address.Address) 

{ "무언가를" }