when you for example connect to an Office 365 account from Exchange and join a group, you see the shared mailbox of that group. When you then browse to your Office 365 mailbox online and not in Exchange, you see that group there as well,
If its a Office365 Group your talking about you can access these via the GetUserUnifiedGroups in the latest version of the Managed API from git hub https://github.com/OfficeDev/ews-managed-api eg
RequestedUnifiedGroupsSet Group = new RequestedUnifiedGroupsSet();
Group.FilterType = UnifiedGroupsFilterType.All;
Group.SortDirection = SortDirection.Ascending;
Group.SortType = UnifiedGroupsSortType.DisplayName;
List<RequestedUnifiedGroupsSet> reqG = new List<RequestedUnifiedGroupsSet>();
reqG.Add(Group);
Collection<UnifiedGroupsSet> ugGroupSet = service.GetUserUnifiedGroups(reqG,"jcool@domain.com");
foreach (UnifiedGroupsSet ugset in ugGroupSet)
{
foreach (UnifiedGroup ugGroup in ugset.Groups)
{
Console.WriteLine(ugGroup.SMTPAddress);
}
}
Mailboxes that where granted access to where Auto-mapping is enabled (these are the Mailboxes that Outlook will Auto-map into a profile) eg Add-MailboxPermission -AutoMapping can be discovered using Autodiscover eg
AutodiscoverService adAutoDiscoverService = new AutodiscoverService(ExchangeVersion.Exchange2013_SP1);
adAutoDiscoverService.Credentials = new NetworkCredential("user@domain.com", "pass");
adAutoDiscoverService.EnableScpLookup = false;
adAutoDiscoverService.RedirectionUrlValidationCallback = adAutoDiscoCallBack;
adAutoDiscoverService.PreAuthenticate = true;
adAutoDiscoverService.KeepAlive = false;
GetUserSettingsResponse gsp = adAutoDiscoverService.GetUserSettings("user@domain.com", UserSettingName.AlternateMailboxes);
Object Mailboxes = null;
if (gsp.Settings.TryGetValue(UserSettingName.AlternateMailboxes, out Mailboxes))
{
foreach (AlternateMailbox Mailbox in ((AlternateMailboxCollection)Mailboxes).Entries)
{
Console.WriteLine(Mailbox.SmtpAddress);
}
}
However Mailboxes where you have just added the rights to a Mailbox or a Folder there is no way of knowing this other then enumerating each of the Mailboxes DACL and check that.