Forum Discussion
Find out if a specific list of email addresses are Team owners and of what Teams
- May 29, 2020
If you want to use the Azure AD cmdlets, Get-AzureADUserOwnedObject should be the fastest way. Best use Exchange PowerShell though:
Get-UnifiedGroup -Filter "ManagedBy -eq '$dn' -and ResourceProvisioningOptions -eq 'Team'"
where $dn is the DistinguishedName of the user you want to check against.
If you want to use the Azure AD cmdlets, Get-AzureADUserOwnedObject should be the fastest way. Best use Exchange PowerShell though:
Get-UnifiedGroup -Filter "ManagedBy -eq '$dn' -and ResourceProvisioningOptions -eq 'Team'"
where $dn is the DistinguishedName of the user you want to check against.
VasilMichev thanks. I've sort of muddled through part of that but couldn't get your quickest method to work. I connected to an online session with the correct role and no joy running it. Would I be correct in saying dn is the username I want to check against i.e firstname.lastname@org.com
- VasilMichevJun 01, 2020MVP
No, it's the DistinguishedName attribute:
$dn = (Get-Mailbox user@domain.com).DistinguishedName