Forum Discussion

fstorer's avatar
fstorer
Brass Contributor
Aug 13, 2022

Find all the AzureADUsers created after a certain date via PowerShell Graph

Hello everyone, As Microsoft will eventually retire the AzureAD and MSOL PowerShell modules (March 2023?), I am trying to update all the PowerShell scripts based on those modules with new ones based...
  • farismalaeb's avatar
    Aug 13, 2022

    fstorer 

    Why the quote around the $Date ??

    remove them and you are good.

    $UsersCreatedDate | Where-Object {($_.CreatedDateTime -gt $Date)}

    Also don't forget to include the all the required property in the Get-MgUser

     

    Get-MgUser -UserId $_.Id -Property CreatedDateTime,JobTitle,UserPrincipalName,id

Resources