Delete mailbox in Exchange Online - Soft delete vs Hard delete (2024)

In this article you will learn how to delete mailbox in Exchange Online using PowerShell. You will learn the difference between soft delete and hard delete mailbox, how to check soft deleted mailbox in Exchange Online, how to restore a mailbox, and how to hard delete a mailbox in Exchange Online.

Table of Contents

How to delete mailbox in Exchange Online

Soft delete vs Hard delete mailbox

When you delete a mailbox in Exchange Online, it is retained in Soft Deleted Mailbox state for 30 days. Administrators have an option to restore the mailbox within this period. This state is called soft delete state.

If an administrator doesn’t restore the mailbox within 30 days, it is deleted permanently (provided litigation hold is not applied). Once the mailbox is deleted permanently, it can not be recovered. This state is called hard delete state.

Connect to Exchange Online and MSOnline PowerShell modules

To be able to run below commands, you need to connect to Exchange Online and MSOnline PowerShell modules. Open Windows PowerShell and run below commands one by one:

PowerShell

Connect-ExchangeOnlineConnect-MSolService
Soft delete mailbox in Exchange Online using PowerShell

To soft delete mailbox in Exchange Online, we will use Remove-Mailbox PowerShell command as shown below:

PowerShell

Remove-Mailbox -Identity "damoSMB" -Confirm:$false

The above command will soft delete mailbox “damoSMB”. To verify the mailbox in soft delete state, run below PowerShell command:

PowerShell

Get-Mailbox -Identity "damoSMB" -SoftDeletedMailbox

To verify all mailboxes in soft deleted sate, run below PowerShell command:

PowerShell

Get-Mailbox -SoftDeletedMailbox

Important: When you soft delete a mailbox in Exchange Online, the associated user account also gets soft deleted.

To verify the soft deleted user account for this mailbox, you need to run below command:

PowerShell

Get-MsolUser -ReturnDeletedUsers

The above command will display the soft deleted user account as shown below:

Delete mailbox in Exchange Online - Soft delete vs Hard delete (1)
Recover deleted mailbox in Exchange Online using PowerShell

To recover soft deleted mailbox in Exchange Online, run below PowerShell command:

PowerShell

Undo-SoftDeletedMailbox -SoftDeletedObject "damoSMB"

Important: The above command will recover soft deleted mailbox “damoSMB” and its associated user account.

Hard delete mailbox in Exchange Online

To hard delete a mailbox in Exchange Online, you need to first delete the user account associated with that mailbox. If you will try to delete an active user mailbox without deleting the associated account, you will get an error that says “This mailbox cannot be permanently deleted since there is a user associated with this mailbox in Azure Active Directory“.

To delete a user account associated with the mailbox, run below PowerShell command:

PowerShell

Remove-MsolUser -UserPrincipalName "[emailprotected]" -Force

To delete the user account permanently, run below PowerShell command:

PowerShell

Remove-MsolUser -UserPrincipalName "[emailprotected]" -RemoveFromRecycleBin -Force

To hard delete a mailbox, run below PowerShell command:

PowerShell

Remove-Mailbox -Identity "damoSMB" -PermanentlyDelete -Force

Conclusion

In this article you learnt how to delete mailbox in Exchange Online. You might like our other articles on Manage user mailbox using PowerShell, Manage shared mailbox using PowerShell.

If you found this article helpful and informative, please share it within your community and do not forget to share your feedback in the comments below.

Join us on YouTube for the latest videos on the Cloud technology and join our Newsletter for the early access of the articles and updates.

Happy Learning!!

Delete mailbox in Exchange Online - Soft delete vs Hard delete (2024)
Top Articles
Is NSA Spying on You?
Can the NSA wiretap your phone at will?
Hannah Slomowitz
Aes Salt Lake City Showdown
Bmp 202 Blue Round Pill
Table of contents for 5/29/2017 in Woman's World
Trisha Paytas Botched Boob Job
11301 Lakeline Blvd Parkline Plaza Ctr Ste 150
Newburyport Rockport Line
Anime Feet Blogspot
Paisanos Duncan Sc Menu
Marylynn Lee
Craigslist Houston Texas Com
Jailer Showtimes Near Regal Ua Galaxy - Indianapolis
When Does Fortnite Downtime End
Forsyth County, GA population by year, race, & more
Curaleaf Bell Leafly
Angela Aguilar Fapello
Craigslist Sfbay
Cellabsorbv
Wieting Funeral Home
Dan Pfeiffer Message Box
Skip Mega Millions and Powerball. How many million-dollar scratch-off games are there?
Best Restaurants In Financial District Nyc
Fortune House Southbury Menu
Ogeechee Tech Blackboard
10-Day Weather Forecast for Denver, CO - The Weather Channel | weather.com
Charli D'amelio Tribute
Encore Atlanta Cheer Competition
Pirate Proxy List 2022
Aeries Portal Sbcusd
These Bathroom Cabinet Ideas Make Storage Look Beautiful
Dental Injuries 14420
What Auto Parts Stores Are Open
Chase Bank Operating Hours
Craigslist In Visalia California
Wyze Recover Deleted Events
Violent Night Showtimes Near Century 14 Vallejo
Back Page Tyler Texas
Msc News Atchison Ks
H'aanit's Third Chapter | Gamer Guides: Your ultimate sou...
Bmw 328i e46 - oferte
Sams La Habra Gas Price
Sport Clip Hours
Wahlbekanntmachung für die Wahl zum Europäischen Parlament, für die Wahlen des Kreistages, der Gemeindevertretung und der Ortsbeiräte am 9. Juni 2024
Grace Hill Answer Key
Craigslist Gigs Wichita Ks
Frbo Properties
Star Citizen 2024 Review - Is it worth buying? - Gamers By Night
Avalynn_Daniels
Latest Posts
Article information

Author: Amb. Frankie Simonis

Last Updated:

Views: 6517

Rating: 4.6 / 5 (56 voted)

Reviews: 87% of readers found this page helpful

Author information

Name: Amb. Frankie Simonis

Birthday: 1998-02-19

Address: 64841 Delmar Isle, North Wiley, OR 74073

Phone: +17844167847676

Job: Forward IT Agent

Hobby: LARPing, Kitesurfing, Sewing, Digital arts, Sand art, Gardening, Dance

Introduction: My name is Amb. Frankie Simonis, I am a hilarious, enchanting, energetic, cooperative, innocent, cute, joyous person who loves writing and wants to share my knowledge and understanding with you.