Get-AADExportGroups.ps1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<#
 .Synopsis
  Gets the groups
 
 .Description
  GET /users
  https://docs.microsoft.com/en-us/graph/api/group-list
 
 .Example
  Get-AADExportGroups
#>


Function Get-AADExportGroups {
  if((Compare-Object $Type @('Config') -ExcludeDifferent)){
    Invoke-Graph 'groups' -Filter "groupTypes/any(c:c eq 'DynamicMembership')" -QueryParameters @{ expand = 'appRoleAssignments' }
  }
  else {
    Invoke-Graph 'groups' -QueryParameters @{ expand = 'appRoleAssignments' }
  }
}