RSS

how to find the unused mailbox

24 Jun

define: the user do not send mail for more than 60 days.

—-

$xDays = 60Get-Mailbox -OrganizationalUnit yourOU -ResultSize Unlimited -RecipientTypeDetails UserMailbox | Foreach-Object { 
   $si= Get-MailboxFolderStatistics $_ -IncludeOldestAndNewestItems -FolderScope SentItems
   if($si.NewestItemReceivedDate -AND (New-TimeSpan $si.NewestItemReceivedDate.ToLocalTime()).Days -ge $xDays)
   {
      $_
   }}—

from http://blogs.microsoft.co.il/blogs/scriptfanatic/archive/2010/05/31/how-to-discover-unused-mailboxes.aspx

Advertisements
 
 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: