Après beaucoup de recherche et grâce à this post j'ai trouvé une réponse à la question # 1 et # 2
1) Pour obtenir toute la salle de réunion dans votre organisation:
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) Obtenez le calendrier des réunions pour chaque chambre (2 jours):
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);
}
}
}
}
}
A propos de la question n ° 3, ce n'est pas simple d'obtenir ces informations, car il est privat e informations et en tant qu'utilisateur régulier, vous n'avez pas la permission de le voir.