Solved

Deleting old Email Boxes from Exchange 2010

Posted on 2014-12-02
3
43 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
ID: 40476781
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
ID: 40476787
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
ID: 40477044
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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
Local Continuous Replication is a cost effective and quick way of backing up Exchange server data. The following article describes the steps required to configure Local Continuous Replication. Also, the article tells you how to restore from a backup…
In this video we show how to create a User Mailbox 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 Recipients >> Mailb…
The basic steps you have just learned will be implemented in this video. The basic steps are shown to configure an Exchange DAG in a live working Exchange Server Environment and manage the same (Exchange Server 2010 Software is used in a Windows Ser…

831 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