Toby Bianchi: yes I know. However, wouldn't it be nice if we could have a security group, which is allowed to share files and folders directly. And whenever a file or folder is shared with a new external user, he needs to go through the account creation process and thereby self create a new user which visible in Azure AD. Not the site collection level.
This is the major issue I face at the moment.
If you share files or folders directly, those users do not show up as guest users in Azure AD.
Furthermore, I experienced that if I want to get a list of all guest users in my tenant, I need several different Cmdlets, as it seems to a difference whether I for instance grant external access by sharing a site or whether I use Azure AD B2B Collaboration and invite through the Azure Portal.
Both ways lead to an guest user showing up in Azure AD.
Not so in PowerShell. Why that (?)
I'd like to connect to Azure AD and write one cmdlet to get all external guest users. No matter how they have been invited to our tenant.
Is that possible?