I've been tasked with creating a report listing users, department, last date/time they accessed their email account sorted by department.
The example I have provides a lot of information but not the department field, which is located on the EMC Organization tab.
Get-MailboxStatistics -Server EmailSrv01 | Sort LastLogonTime -Descending | Export-Csv "D:\rpts\LastEmailCheck_$(Get-Date -f 'yyyyMMdd').csv" -NoType
Can someone assist me or perhaps share a script you have which provides this information?