but it seems to be a bit more complicated than that.
I’ve already got it working the other way around, getting all users with access to a specific mailbox, using the Exchange Online PowerShell V2 module, but with this I could use some help.
Borg, can you please describe in a bit more detail what you are trying to see for your results? I am able to run the following code with the latest EXOV2 cmdlets and it works just fine. Just as a side note, unless you are calling a command specifically with EXO like Get-EXOMailbox you are still using the classic commands.
if you want something a bit more elegant you can create your own custom object with the following code to display whatever you want the output object to look like:
“This this account disabled?” = $mbx.AccountDisabled
}
You can also use calculated properties (known as an expression) to achieve the same solution. To modify the output with calculated properties it will require a Hashtable object denoted by @{} and it will contain a Name and an Expression key. The name key is the property name that you want to use and the Expression key will be a scriptblock that is going to be executed when the Select-Object cmdlet receives input from the pipeline: Get-Mailbox - Get-Mailbox -RecipientTypeDetails UserMailbox,SharedMailbox -ResultSize Unlimited | Select-Object -Property Identity, @{Name =“DN”; Expression = {$_.DistinugishedName}}
You can keep building on to these examples to add all the rest of the data that you require. I hope this helps!