Office 365 Exchange Mailbox Properties

749 views Asked by At

I would like to know how to access a set of given mailboxes and get various properties on those mailboxes. Specifically I would like to iterate through a list of email addresses, and spit out the type of mailbox (ie: room mailbox, user mailbox , etc.)and who and what type of access users have. I've been looking at url below, but cant find much on this type of thing.

https://code.msdn.microsoft.com/Office365/

An code samples would be greatly appreciated.

Pseudo Code:

ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2013);
var MyMailboxes = service.getMailboxes(MyListofMailboxes);

foreach(var mailbox in MyMailboxes)
{
    Console.WriteLine("MailboxType: {0}" + mailbox.MailboxType); 
    foreach(var userAccess in mailbox.UserAccess)
    {
         Console.Writeline("User: {0}, Access Level: {1}", userAccess.user, userAccess.AccessLevel);
    }
}
1

There are 1 answers

0
Glen Scales On BEST ANSWER

You need to use Remote Powershell to do that see https://msdn.microsoft.com/en-us/library/office/ff326159(v=exchg.150).aspx. You can the use Get-Mailbox, Get-MailboxPermission and Get-MailboxFolderPermissions . EWS is only useful if you want to access the Mailbox content for Admin tasks you should use Remote Powershell.

Cheers Glen