What would be a PowerShell script to export all Azure AD groups, their members and owners into one CSV file?
I also need an expanded nested groups.
What would be a PowerShell script to export all Azure AD groups, their members and owners into one CSV file?
I also need an expanded nested groups.
On
Sorry couldn't comment as I don't have enough rep, I created an account to thank you Peter.
This worked a treat. I had tried multiple other articles but this one works. All I did was to target groups with a specific naming scheme was change this line and remove $true as that said 'a positional parameter cannot be found that accepts the argument True'
$groups = Get-AzureADGroup -SearchString "File Share"
That then searches for any group starting with 'File Share'
Here is something I came up with. It should work as long as you have the AzureAD PowerShell module.
This will give you a file in the current folder where the script is. Called groupusers, the first field will contain the group and if it's a nested group member it would show like group->nestedgroup, owner or member, etc.