Vapor365 Posted March 21, 2014 Posted March 21, 2014 Hey guys, I'm relatively new to O365 and was wondering how to properly delete a user's mailbox in the cloud. We are in a Hybrid environment so using the Admin Portal to find the user and click the trash-can does not work. I also don't see any options to delete a user's mailbox in the Exchange Management Console either. I've seen a few posts saying to remove-mailbox in msol, but my concern is this: We have users who are also licensed for sharepoint and have stuff in OneDrive. If I remove the user completely from MSOL, will it also remove all their sharepoint / OneDrive stuff as well as the mailbox? I'm hoping it's just something I don't know about, like a commandlet after connecting to the cloud or something. Thanks in advance! P.S. Glad to see there's a forum like this out there!
the_dude Posted March 21, 2014 Posted March 21, 2014 (edited) It sounds like you want to just remove the mailbox and not the user account? You could unlicense them for exchange.. The reason you can't just delete them in the portal is because you probably have Active Directory Synchronization turned on. With this on, all changes need to be done on-premise in your AD and then synced to the cloud. You could deactivate it (takes a while) and then your powershell command would work. Re-activate when done. The command should just remove the mailbox. MS tech support can help you with this too, just submit a ticket. Edited March 21, 2014 by the_dude
Vapor365 Posted March 21, 2014 Author Posted March 21, 2014 I tried to do a Disable-mailbox, which seemed to work correctly (It removed the on-prem AD object's exchange attributes), but after DirSyncing and waiting, the mailbox still exists in the cloud (I can see it doing get-mailbox or in the admin portal). Is there something else I have to run to remove it completely from the cloud? I get that using AD DirSync I have to change things locally for them to reflect in the cloud, but the mailbox is just sitting there on the cloud now. I thought it would have gone into a soft-deleted container where I could actually remove it from the cloud, but it doesn't. To take it one-step further, I tried to do an enable-mailbox command against the user account here on prem to see if it would override the mailbox in the cloud. Unfortunately, it actually re-connected to the mailbox. I think I'm missing a step here...
the_dude Posted March 21, 2014 Posted March 21, 2014 Typically I've also removed the user. Since you are just deleting the mailbox, I think you want to stop dirsync, connect your powershell to the cloud, run the powershell command to delete the mailbox, and restart dirsync. This may bring the box back though. I would open a ticket with MS to be sure....
potato2014 Posted March 22, 2014 Posted March 22, 2014 The correct way (correct me if I'm wrong) is to migrate the mailbox back to on-premise and delete it the usual way.
Vapor365 Posted March 24, 2014 Author Posted March 24, 2014 Well, in testing, I was able to successfully remove a test user from MSOL (then the recycle bin), which deleted the test user's email. After running a dirsync which created the test user, and then applying proper licenses, it re-linked the test user's Sharepoint and Onedrive, while creating a new blank mailbox. I'm not sure if this is the "proper" way, and I don't know the retention time of the orphaned Sharepoint / OneDrive, but it worked...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now