Solved

Deleting old Email Boxes from Exchange 2010

Posted on 2014-12-02
3
38 Views
Last Modified: 2015-02-24
Is there a way to run a report on the exchange server to see the last time someone logged into an email box. We have let our email get out of control and we need a way to be able to figure out a simplistic way of deleting them. We use to just ask for a list but the list was never correct so we figured if there was a way to find out the last time someone logged into their account we could just go from there.......any other suggestions would be welcomed.
0
Comment
Question by:wcody
3 Comments
 
LVL 4

Expert Comment

by:SEHC
Comment Utility
hi,

This is an AD PowerShell command that will tell you which users have not logged in over a year but you can change the number to what you want. you will need to edit the domain and the days.  you can add in any other search parameters you want from LDAP.

Save the below as a .ps1


$365Days = (get-date).adddays(-365)

Get-ADUser -SearchBase "ou=test,dc=doamin,dc=com" -filter {(lastlogondate -notlike "*" -OR lastlogondate -le $365days) -AND (passwordlastset -le $365days) -AND (enabled -eq $True)} -Properties lastlogondate, passwordlastset,title,office,employeeID | Select-Object employeeID, name, lastlogondate, passwordlastset, title, office |export-csv c:\stale-users365.csv
0
 
LVL 35

Accepted Solution

by:
Joseph Daly earned 500 total points
Comment Utility
You could do something like

Get-Mailbox {user}| Get-MailboxStatistics | select-object lastlogontime, lastloggedonuseraccount

or

Get-Mailbox * | Get-MailboxStatistics | select-object lastlogontime, lastloggedonuseraccount
0
 
LVL 16

Expert Comment

by:Rajitha Chimmani
Comment Utility
Addition to the Exchange command..You might be interested to know the account name

Get-Mailbox -Resultsize unlimited | Get-mailboxtstatistics | Select DisplayName,LastLogonTime,LastLoggedOnUserAccount

Open in new window


You can add switch -RecipientTypeDetails to run the query against user and room mailboxes separately and export the results to a csv like

Get-Mailbox -Resultsize unlimited -RecipientTypeDetails UserMailbox | Get-mailboxtstatistics | Select DisplayName,LastLogonTime,LastLoggedOnUserAccount | Export-csv users.csv -Notypeinformaion

Open in new window

0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Disabling the Directory Sync Service Account in Office 365 will stop directory synchronization from working.
This process describes the steps required to Import and Export data from and to .pst files using Exchange 2010. We can use these steps to export data from a user to a .pst file, import data back to the same or a different user, or even import data t…
To show how to generate a certificate request in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.:  First we need to log into the Exchange Admin Center. Navigate to the Servers >> Certificates…
The video tutorial explains the basics of the Exchange server Database Availability groups. The components of this video include: 1. Automatic Failover 2. Failover Clustering 3. Active Manager

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now