Importing

Must use Windows PowerShell (not PowerShell 7)

Import-Module AzureAd -UseWindowsPowerShell

Connecting

Connect-AzureAD

Get a List of Groups of Which User is a Member

Get-AzureADUser -SearchString hanawayc@gejohnson.com | Get-AzureADUserMembership | % {Get-AzureADObjectByObjectId -ObjectId $_.ObjectId | select DisplayName,ObjectType,MailEnabled,SecurityEnabled,ObjectId} | Format-Table

Get a List of groups of Which User is an Owner

Get-AzureADUser -SearchString user@example.com | Get-AzureADUserOwnedObject

AzureAD POSH module is deprecated in favor of MS Graph.