Forum Discussion

TobiasAT's avatar
TobiasAT
Steel Contributor
Mar 27, 2018

Get-AzureADMSDeletedGroup vs. 'Get-UnifiedGroup -IncludeSoftDeletedGroups'

Hello, I have a question reqarding deleted Office 365 Groups. I have the two scenarios: 1st: I run "Get-AzureADMSDeletedGroup | ?{$_.DeletedDateTime -gt $DeletedGroupsStartDate }" and get 5 de...
  • TobiasAT's avatar
    TobiasAT
    May 09, 2018

    Yesterday I found the cause. There are 2 issues preventing the EXO and AAD cmdlets returning the same results for deleted groups.

     

    1. The time zone in AAD is UTC, EXO returns the results in the local time. So I changed the date filter for deleted groups in AAD to UTC.
    2.  The main issue is Get-AzureADMSDeletedGroup does not return all deleted groups by default (and shows not information the results are limited). The cmdlet provides an additional parameter All.

    Get-AzureADMSDeletedGroup -all:$true

     

    -All
    If true, return all group members. If false, return the number of objects specified by the Top parameter

     

    Without the parameter Get-AzureADMSDeletedGroup returns just 100 results and the date filter was not applied to all deleted groups in AAD.

    I did the same tests, one for the last 5 days and one for 30 days. Both commands include now the same results.

     

Share

Resources