Microsoft Exchange Server 2016 PowerShell Cookbook - Fourth Edition
by Jonas Andersson, Nuno Mota, Mike Pfeiffer
How it works...
Here, you can see that we're retrieving all of the mailboxes in the organization using the Get-Mailbox cmdlet. We then pipe this collection to the Where-Object cmdlet (using the ? alias) and use the Get-MailboxStatistics cmdlet to build a filter. This first part of this filter indicates that we only want to retrieve mailboxes that have a value set for the LastLogonTime property. If this value is $null, it indicates that these mailboxes have never been used and have probably been recently created, which means that they will probably soon become active mailboxes. We could also include the WhenMailboxCreated property to check when they were created.
The second part of the filter compares the value for the LastLogonTime property. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access