I'm currently rewriting a few PowerShell commands for retrieving user and group information from AAD. Previously we used the Connect-MSOLService and Get-MSOLGroup commands to fetch information about groups. Due to preparations for MS MFA requirements we are now trying to use Connect-AzureAD and Get-AzureADGroup commands with MFA for setting up the connection and retrieving information from AAD instead.
The problem I encountered was in missing/difference in attributes retrieved by the commands. For example, when retrieving groups with the Get-MSOLGroup command we had access to the CommonName property of all groups. However, using the Get-AzureADGroup command this property is no longer present on the objects returned as a result. See the images below for the properties available between the two commands.
I have spent quite some time trying to figure this out and can't seem to find any documentation or explanation for the differences between the properties retrieved by the commands. Have anyone come across this before, have any suggestions for a workaround or have a different approach for retrieving the same attributes provided by the Get-MSOLGroup command using Get-AzureADGroup (or equivalent)?
Worth mentioning is that we search for groups by their CommonName attribute to check their existence from our on-prem application. I have also tried using the Get-AzureADMSGroup command, but it seems to return the same properties attached to each group. The groups are created in a on-prem AD and then synced to AAD by using Azure AD Connect.
Update:
Added the query we are currently running to check existence of groups based on their CommonName in the image below.