File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed
src/m365/entra/commands/group Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -368,7 +368,7 @@ describe(commands.GROUP_LIST, () => {
368
368
369
369
it ( 'lists all distribution groups in the tenant' , async ( ) => {
370
370
sinon . stub ( request , 'get' ) . callsFake ( async ( opts ) => {
371
- if ( opts . url === `https://graph.microsoft.com/v1.0/groups?$filter=securityEnabled eq false and mailEnabled eq true` ) {
371
+ if ( opts . url === `https://graph.microsoft.com/v1.0/groups?$filter=securityEnabled eq false and mailEnabled eq true and not(groupTypes/any(t:t eq 'Unified'))&$count=true ` ) {
372
372
return {
373
373
"value" : [
374
374
{
Original file line number Diff line number Diff line change @@ -92,7 +92,8 @@ class EntraGroupListCommand extends GraphCommand {
92
92
requestUrl += '?$filter=securityEnabled eq true and mailEnabled eq false' ;
93
93
break ;
94
94
case 'distribution' :
95
- requestUrl += '?$filter=securityEnabled eq false and mailEnabled eq true' ;
95
+ useConsistencyLevelHeader = true ;
96
+ requestUrl += `?$filter=securityEnabled eq false and mailEnabled eq true and not(groupTypes/any(t:t eq 'Unified'))&$count=true` ;
96
97
break ;
97
98
case 'mailEnabledSecurity' :
98
99
useConsistencyLevelHeader = true ;
@@ -139,7 +140,7 @@ class EntraGroupListCommand extends GraphCommand {
139
140
140
141
if ( cli . shouldTrimOutput ( args . options . output ) ) {
141
142
groups . forEach ( ( group : ExtendedGroup ) => {
142
- if ( group . groupTypes && group . groupTypes . length > 0 && group . groupTypes [ 0 ] === 'Unified' ) {
143
+ if ( group . groupTypes && group . groupTypes . length > 0 && group . groupTypes . includes ( 'Unified' ) ) {
143
144
group . groupType = 'Microsoft 365' ;
144
145
}
145
146
else if ( group . mailEnabled && group . securityEnabled ) {
You can’t perform that action at this time.
0 commit comments