Avatar of sturgeontire
sturgeontire
 asked on

Please Verify This Exchange 2007 Shell Command

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!
Exchange

Avatar of undefined
Last Comment
Manpreet SIngh Khatra

8/22/2022 - Mon
Stelian Stan

That's correct. To verify if that mailbox still exist run this:

get-mailbox -Identity "username" | fl

then

Get-Mailbox "username" -DeleteContent WhatIf
ASKER CERTIFIED SOLUTION
Manpreet SIngh Khatra

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Manpreet SIngh Khatra

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
sturgeontire

ASKER
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.
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
Manpreet SIngh Khatra

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
sturgeontire

ASKER
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.
Manpreet SIngh Khatra

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"
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.