none
EWS Managed API - Get room mailbox properties RRS feed

  • Question

  • Hi,

    I am using EWS API 2.2 downloaded from https://www.microsoft.com/en-us/download/details.aspx?id=42951 (Microsoft.Exchange.WebServices )for my outlook add in development. As i am new to this, I am initially trying this out using a console app.

    I am trying to fetch the room mailbox properties, but unable to get everything. This is my code to get the room information.

    var roomLists = _exchangeService.GetRoomLists();
    Console.WriteLine("Getting Room lists..");
    foreach (EmailAddress room in roomLists)
    {
    Console.WriteLine($"Address: {room.Address} MailboxType: {room.MailboxType}");
    var roomAddresses = _exchangeService.GetRooms(room);
    foreach (EmailAddress r in roomAddresses)
    { Console.WriteLine($"{r.Address} / {r.MailboxType}"); }

    }

    I need the RoomCapacity, Location, BookingLeadTime etc...

    Using PowerShell I am able to do: Get-Mailbox -RecipientTypeDetails RoomMailbox | fl. This returns all the rooms along with the properties.

    How do i achieve the above using C# and EWS API?

    Please Help.

    Tuesday, August 7, 2018 5:12 AM

All replies

  • Hi Sanketh,

    Based on my tests, you can use ResolveName function to get more information. For details, please see the code as below:

    EmailAddressCollection myRoomLists = service.GetRoomLists();
            foreach (EmailAddress address in myRoomLists)
            {
                EmailAddress myRoomList = address.Address;
                PropertySet AllProps = new PropertySet(BasePropertySet.FirstClassProperties);
                NameResolutionCollection ncCol = service.ResolveName(address.Address, ResolveNameSearchLocation.DirectoryOnly, true, AllProps);
                foreach (NameResolution nr in ncCol)
                {
                    Console.WriteLine(nr.Contact.DisplayName);
                    Console.WriteLine(nr.Contact.Notes);
                }
            }
    Related post: exchange-2013-api-get-room-properties

    Hope it helps you.


    Thanks,

    Yuki

    Tuesday, August 7, 2018 10:42 AM
    Moderator
  • Hi Yuki,

    I have already see this post. But from Contact object i was not able to figure out how do i get the room properties as i couldn't see any property related to it?

    Please can you help me out here.

    Thanks,

    Sanketh

    Tuesday, August 7, 2018 12:47 PM
  • Hi Sanketh,

     

    Thanks for your reply. Based on my test, there's no good way to get room properties. As mentioned in the previous post, Room Capacity is not a property exposed by EWS.

    So I think you need to use LDAP/MailTip (EWS managed API using C#) to get it.

    For more information about this:

    Configure custom MailTips for recipients

    GetMailTips Operation

     

    Hope it helps you.

    Thanks,

    Yuki



    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread.

    Wednesday, August 8, 2018 6:56 AM
    Moderator
  • Hi Sanketh,

    Hope your updates and feedback. Any questions or concerns, feel free to let me know. Looking forward to your reply.   

    Best Regards,

    Yuki


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread.

    Monday, August 13, 2018 1:51 AM
    Moderator