Import-Module Microsoft.Graph.DirectoryObjects
$params = @{
securityEnabledOnly = $false
}
Get-MgDirectoryObjectMemberGroup -DirectoryObjectId $directoryObjectId -BodyParameter $params
This example will check group memberships for a directory object