Solved

Deleting old Email Boxes from Exchange 2010

Posted on 2014-12-02
3
42 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

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…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
In this video we show how to create a Contact 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 >> Contact ta…
This video demonstrates how to sync Microsoft Exchange Public Folders with smartphones using CodeTwo Exchange Sync and Exchange ActiveSync. To learn more about CodeTwo Exchange Sync and download the free trial, go to: http://www.codetwo.com/excha…

895 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

14 Experts available now in Live!

Get 1:1 Help Now