Forum Discussion

bala_bron's avatar
bala_bron
Copper Contributor
Mar 29, 2023

how to add timezone in Exchange Audit cmdlets ?

Need to add a custom time with utc timezone in StartDate and Enddate parameters. I have tried the below . are these fine to use ?

 

Search-UnifiedAuditLog -StartDate ([DateTime]'01/24/2023 17:35:18 PM Z') -EndDate ([DateTime]'01/24/2023 18:35:18 PM Z')

 

Search-UnifiedAuditLog -StartDate ([DateTime]'01/24/2023 17:35:18 Z') -EndDate ([DateTime]'01/24/2023 18:35:18 Z')

  • In the first command, you have used the time format hh:mm:ss PM Z, which includes an unnecessary PM indicator as well as the time zone Z.
    • bala_bron's avatar
      bala_bron
      Copper Contributor
      in Exchange online V3 module , without Z the audit logs takes my local time instead of UTC. this was not the case in V2 module. so, I am using this format .

Resources