Solved

Please Verify This Exchange 2007 Shell Command

Posted on 2012-12-24
10
72 Views
Last Modified: 2016-06-29
We want to empty a specific user's mailbox on our Exchange 2007 server.

I believe the proper shell command would be:

Get-Mailbox "username" -DeleteContent

Where "username" is obviously the username of the person involved.

Is this command correct? We want the mailbox to still exist; we just want to clear out all outlook data in it.

Thank you!
0
Comment
Question by:sturgeontire
[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
  • 4
  • 2
10 Comments
 
LVL 23

Expert Comment

by:Stelian Stan
ID: 38718717
That's correct. To verify if that mailbox still exist run this:

get-mailbox -Identity "username" | fl

then

Get-Mailbox "username" -DeleteContent WhatIf
0
 
LVL 52

Accepted Solution

by:
Manpreet SIngh Khatra earned 500 total points
ID: 38718723
You have to Export the data to a PST

Export-Mailbox –Identity user@domain.com -DeleteContent -PSTFolderPath "\\server\folder\pstfile.pst" -BadItemLimit 10000

http://social.technet.microsoft.com/Forums/en-US/exchangesvradminlegacy/thread/58fe9f8d-565c-474b-a8e1-90b2ed7c946f

or else simply Export all data to PST and then disable Mailbox and create a new mailbox

- Rancy
0
 
LVL 52

Expert Comment

by:Manpreet SIngh Khatra
ID: 38718739
sturgeontire: Have you tried the command as far as i know this cannot delete any content in the Mailbox please if you can confirm

- Rancy
0
Office 365 Training for IT Pros

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

 

Author Comment

by:sturgeontire
ID: 38718745
Hi Rancy,

I will try it and let you know - may not be until later as I am busy with other stuff and wanted to get the command out of the way.

J.
0
 
LVL 52

Expert Comment

by:Manpreet SIngh Khatra
ID: 38718764
The reason i say is cause Get-Mailbox simply gives you Attribute information and not Mailbox data information so i dont think its that simple with Exchange 2007 whereas in Exchange 2010 you have the Search-Mailbox but Export-Mailbox in Exchnage 2007 cant be run from the Exchange server .... one would need to install tools on some client machine and work so a BIG headache in a way

Get-Mailbox
http://technet.microsoft.com/en-us/library/bb676556(v=EXCHG.80).aspx

- Rancy
0
 

Author Comment

by:sturgeontire
ID: 38718812
Rancy - the original command I asked about did not work because -DeleteContent caused an error.

I tried your suggestion, but after entering it, I get a ">>" prompt that appears to want more input.

I've just been advised to delete the user anyway, but I would like to get this to work for future reference (throw it in my procedure file).

Thanks for your help.
0
 
LVL 52

Expert Comment

by:Manpreet SIngh Khatra
ID: 38719057
So firstly you marked the solution to wrong post and quiet quickly :( (So you should ideally hit Request Attention)

Look as i said you can get the data to a PST normally and then do a Disable and New mailbox ........... also as i said this cant be done from Exchange Shell on the server ....... you have to install Exchange Management tools on a 32 bit client and then run from there

How to Export and Import mailboxes to PST files in Exchange 2007 SP1
http://blogs.technet.com/b/exchange/archive/2007/04/13/3401913.aspx

- Rancy
"Merry Christmas and Happy New Year"
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Mailbox Delegation List 46 127
Changing "From" field - Exchange 2013 5 58
Exchange Mail forwarding 9 43
Active Directory GPOs and OUs 2 14
Follow this checklist to learn more about the 15 things you should never include in an email signature from personal quotes, animated gifs and out-of-date marketing content.
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 Shared 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 >> Sha…
In this video we show how to create a mailbox database 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 Servers >> Data…

738 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