Forum Discussion
Gwendot
Jan 21, 2020Copper Contributor
Help cannot fin cmd
Hi, I try to get some data from Office 365 usage, that are not available in Microsoft 365 Usage Analytics. Which cmd powershell will Get me the mailboxes that did not logon since 3 month? 6 month? ...
chrisream
Microsoft
Jan 23, 2020Get-Mailbox | Get-MailboxStatistics | Where-Object {$_.LastLogontime -lt ((get-date).addmonths(-3))}
The [datetime] object has many methods available. By adding a negative number, you're going "back in time".
AddDays
AddHours
AddMilliseconds
AddMinutes
AddMonths
AddSeconds
AddTicks
AddYears