Office 365 is a popular cloud-based platform for managing emails, contacts, and other data. When a user is deleted from Office 365, their account is moved to a “soft-deleted” state and held in the Recycle Bin for a certain amount of time. However, it is important to remove soft-deleted users permanently in order to free up storage space, enhance security, and improve data accuracy. In this blog, we will guide you through the process of hard deleting contacts from Office 365 using the Connect-MsolService PowerShell command. In short, you are going to learn how to remove deleted users from Office 365 permanently.
What Happens When you Delete an Office 365 User?
When an Office 365 user is deleted, the account is moved to the recycle bin for a retention period of 30 days. During this time, the account can be restored if needed. After the 30-day retention period, the user and their associated data will be permanently deleted.
Moreover, when you delete an Office 365 user, the following actions occur:
- The user’s license is removed: The license for the user’s Office 365 account is revoked, which effectively disables the user’s access to all Office 365 services and features.
- The user’s data is retained: The user’s data, including emails, calendar events, and files, is retained for a specific period of time, as specified by the organization’s retention policy. By default, the retention period is 30 days.
- The user’s data is marked for deletion: The user’s data is marked for deletion, but it is not immediately deleted. Instead, the data remains in the Exchange Online mailbox and OneDrive for Business site for the specified retention period.
- The user’s data becomes inaccessible: Once the retention period has passed, the user’s data becomes inaccessible to other users and the deleted user’s account is considered “soft deleted.”
- The user’s data can be recovered: During the retention period, an Exchange Online administrator can recover the deleted user’s data by restoring the user’s account. After the retention period has passed, the deleted user’s data can still be recovered, but only by an Exchange Online administrator.
- The user’s data is permanently deleted: After the retention period has passed, the deleted user’s data is permanently deleted and cannot be recovered. The exact timeline for permanent deletion depends on the organization’s retention policy and other factors.
It’s important to note that once an Office 365 user is deleted, all data associated with the user, including emails, will be permanently deleted and cannot be recovered. Before deleting a user, make sure that any important data associated with the user has been backed up or transferred to another account.
Also Read: How to Configure Office 365 Email to Thunderbird: A Step by Step Guide
Why Do You Need to Remove Deleted Users from Office 365 Permanently?
When a user is deleted from Office 365, their account is not immediately permanently removed. Instead, it is moved to a “soft-deleted” state, where it is held in the Recycle Bin for a certain amount of time before it is permanently deleted. This allows for the possibility of restoring the account if necessary.
However, it is important to remove deleted users from Office 365 permanently in order to:
- Free up storage space: Soft-deleted users still occupy space in the Office 365 environment, and removing them permanently frees up that space.
- Enhance security: Deleted users’ data can still be accessed if the account remains in the Recycle Bin, which can pose a security risk if sensitive information was stored in the account.
- Improve data accuracy: Keeping soft-deleted users in the Recycle Bin can lead to confusion and inaccuracies in reporting and other data-related activities.
Therefore, it is recommended to remove deleted users from Office 365 permanently in order to optimize the use of resources and enhance security and data accuracy.
Also Read: How Long Does Office 365 Keep Deleted Emails? Learn Retention Period of Office 365
Steps to Hard Delete Office 365 User Using PowerShell
Here is the procedure to hard delete contacts from Office 365 using the “Connect-MsolService” PowerShell command:
Open the Windows PowerShell application on your computer.
Run the following command to connect to Azure Active Directory:
You will be prompted to enter the admin credentials of the Office 365 account. Enter the credentials in the dialog box.
Once you are connected, you can use the following command to retrieve a list of all the soft-deleted contacts in your organization:
To hard delete a specific contact, use the following command and replace “ObjectId” with the actual ObjectId of the contact:
Continue with this operation?
[Y] Yes [N] No [S] Suspend [?] Help (default is “Y”): y
PowerShell Command to Permanently Remove Bulk Deleted Users from Office 365
To hard delete all soft-deleted contacts, you can use the following command:
Hard deleting soft-deleted contacts from Office 365 is an important task to optimize the use of resources, enhance security, and improve data accuracy. By following the step-by-step guide provided in this blog, you can easily Remove Deleted Users from Office 365 Permanently using the Connect-MsolService PowerShell command. However, it is important to keep in mind that this process is irreversible, so make sure you have a backup of the contacts before proceeding with the deletion.