forked from OfficeDev/O365-InvestigationTooling
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reworked this script to use Get-Mailbox instead of Get-MSOLUser, since if you have an AD synced Tenant, this will probably have a good number of MSOLUsers that aren't tied to Mailboxes. Moved big Get-Mailbox pull to top and reused the data Added Mailbox param to UPN (to save having to re-lookup whose mailbox it's connected to) Also, fixes (OfficeDev#41)
- Loading branch information
1 parent
4874135
commit cc07c0c
Showing
2 changed files
with
11 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cc07c0c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reworked this script to use Get-Mailbox instead of Get-MSOLUser and then hopefully finding Matching Mailboxes by UPN
If you have a DirSynced AAD, not all MSOL Users will have a Mailbox by a LONG shot, unless you configured your sync rules really well.
I ran this against about 6 client tenants, and found that this wasn't very useful, as-is.
The problem is that the extra MSOL accounts glob up the Command window, making it look like it's failing all over the place, and just.... ugly.
Plus, why are we trying to find the Mailboxes by the MSOLUsers in the first place? If we want Mailboxes and THEIR info, let's start with mailboxes.
This gives you an idea how many MSOLUsers do not have a matching mailbox, and how there are sometimes mailboxes without a matching MSOLUser
Long story short, looking up from MSOLUser -> Mailbox might not always be 100% right.
I also can't think there would ever be a situation where you would have an extra mailbox with no MSOL User it is connected to.