Is there a PowerShell command for finding out where specific AD groups are used in SharePoint Online? We have several old AD groups that were used at one time and added to SharePoint groups for permissions. I need to find out if they are still used anywhere so I can delete the ones that are not. Is there a PowerShell script, I'm guessing using Get-SPOUser, out there that will tell me what sites are still using a specific AD group in a SharePoint permissions group?
I had need of a solution to this as well, so I figured I would share what I've done.
I did some research, and I had some scripts already as starting points, but everything seemed to be based on crawling through all the list items in the all the lists in all site collections/subsites/modern sites etc. Clearly in even a moderately sized tenant that would be slow. I considered using Powershell jobs to do more in paraellel but it was clearly still going to be slow.
In the end, I settled on a different approach which is to get information from the "User Information List" for each site collection/modern site/group site.