I hate Graph powershell as a replacement for the AzureAD module

Posted by sham_hatwitch@reddit | sysadmin | View on Reddit | 87 comments

I am updating our user onboarding script to not use the AzureAD module.

I used to have a very simple check to find groups that are not synced from on-prem and are not mail-enabled security (if so it would go to ExchangeOnline).

Trying to do this in Graph feels like the wheel was reinvented. Some properties are in -Property, others are buried in .GroupDetails, OnPremisesSyncEnabled can't be retrieved so instead I need to get the last sync time and select ones that are Null.

Oh and you can't just search for groups the user is a member of, it doesn't find them all so you have to do a Get-MgUserTransitiveMemberOf instead.

I can't even figure out the GroupType, it outputs "dynamic" for a dynamic group, and Null for every other group, it seems types like unified, mail enabled, etc... are buried in different properties all over the place.

Worst of all is if you ask Co-Pilot for help, it will confidently spit out commands that error because the property it's calling doesn't exist, then you will tell it that didn't work, it'll try something else that doesn't work, then if you complain it will spit out the first non-working command again.