Howto Find and Remove Inactive Exchange Users older than 90 days

Howto Find and Remove Inactive Exchange Users older than 90 days using power shell/GUI
LVL 1
harisaboobakerAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

harisaboobakerAuthor Commented:
This is only Active Directory users .I want to remove exchange inactive user mailbox older than
90 days from exchange server

when We remove inactive user from active directory ..that user mailbox are Disconnected state again we remove disconnected mailboxes
0
jerseysamCommented:
You can find those inactive mailboxes:

$mailboxes = Get-Mailbox -ResultSize Unlimited
$mailboxes | ?{
  (Get-MailboxStatistics $_).LastLogonTime -and `
  (Get-MailboxStatistics $_).LastLogonTime -le `
  (Get-Date).AddDays(-90)
0
Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Sanjay SantokiCommented:
Hello,

First of all you have to fetch list of mailboxes which are not opened since last 90 days. You can get them using with the following command;

get-mailboxstatistics -database yourdbname | Sort-Object LastLogonTime -Descending  export-csv "csvfilepath"

Then you can open csv file in excel and prepare a list of user account and delete mailboxes from Exchange server.

Regards,
Sanjay Santoki
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
jerseysamCommented:
Have you thought of using retention policies moving forward?

http://sysadmin-talk.org/2010/04/manage-exchange-retention-policies-before-they-manage-you/
0
Sanjay SantokiCommented:
Hello,

To remove disconnected mailboxes; you just need to rung following command;

Clean-MailboxDatabase yourdbname

Regards,
Sanjay Santoki
0
SubsunCommented:
when We remove inactive user from active directory ..that user mailbox are Disconnected state again we remove disconnected mailboxes
When you remove the mailbox it will be in disconnected state based on your MailboxRetention period settings (By default it will be 30 days).

If you don't want to keep this disconnected mailboxes then you can set the MailboxRetention to 0..

Set-MailboxDatabase <database_name> -MailboxRetention <Retention Time>

Or you can permanently delete a disconnected mailbox..
Ref : http://technet.microsoft.com/en-us/library/gg181092(v=exchg.141).aspx

But keep in mind that once you remove the disconnected mailbox then you can only recover the mailbox from backup..
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Exchange

From novice to tech pro — start learning today.