Hi,
Periodically, I run a script like this that brings up a couple Out-Gridview windows with Exchange Online data. Exchange is all UTC all the time, but for the purposes of this display (there's one column that has the date and time), I'd like to convert it to local time.
The closest that I've come to finding something on this is a function that can do the conversion, but I don't really know how to incorporate it into something like this.
$dateEnd = get-date $dateStart = $dateEnd.AddHours(-48) Get-MessageTrace -StartDate $dateStart -EndDate $dateEnd | Select-Object Received, Status, SenderAddress, RecipientAddress, Subject, Size, FromIP, MessageId, MessageTraceId, Index | Where {$_.Status -eq "Failed" -Or $_.Status -eq "FilteredAsSpam"} | Sort-Object Status | Out-GridView -Title "Message Tracking Data (since $dateStart)" Get-MessageTrace -StartDate $dateStart -EndDate $dateEnd | Where {$_.Status -eq "Failed"} | Get-MessageTraceDetail | Select-Object Date, Event, Action, Detail, Data, MessageID | Sort-Object Date | Out-GridView -Title "Failed Messages (since $dateStart)"