Solved

Deleting old Email Boxes from Exchange 2010

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

Lotus Notes – formerly IBM Notes – is an email client application, while IBM Domino (earlier Lotus Domino) is an email server. The client possesses a set of features that are even more advanced as compared to that of Outlook. Likewise, IBM Domino is…
How to resolve IMCEAEX NDRs in Exchange or Exchange Online related to invalid X500 addresses.
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 shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

828 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