?
Solved

Deleting old Email Boxes from Exchange 2010

Posted on 2014-12-02
3
Medium Priority
?
47 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 1500 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

Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.

Question has a verified solution.

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

Learn to move / copy / export exchange contacts to iPhone without using any software. Also see the issues in configuration of exchange with iPhone to migrate contacts.
Read this checklist to learn more about the 15 things you should never include in an email signature.
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…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Suggested Courses

800 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