Solved

Re-instating AD user accounts and mailboxes removed using remove-mailbox -identity "/o=MYORGANISATION/ou=Exchange Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=USERNAME" -confirm:$false

Posted on 2016-08-01
6
33 Views
Last Modified: 2016-08-26
I mistakenly included a few users in a script  to remove AD user accounts and their mailboxes  remove-mailbox -identity "/o=MYORGANISATION/ou=Exchange Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=USERNAME" -confirm:$false.

Is there a quick way of getting back these. I know I should use disable instead of remove but I was doing housekeeping on accounts that had been dormant for over a year and wasn't aware how these 3 accounts sneaked in there.

Any help appreciated.
GospodinRasputin.
0
Comment
Question by:GospodinRasputin
  • 3
  • 3
6 Comments
 
LVL 24

Accepted Solution

by:
-MAS earned 500 total points
ID: 41737101
Run the below command to see the mailboxes in the disconnected mailbox.
Get-mailboxdatabase | Clean-MailboxDatabase

Open in new window


If you are running Exchange2013 you have to run
update-StoreMailboxState

Open in new window

https://blogs.technet.microsoft.com/nawar/2014/11/20/clean-mailboxdatabase-and-exchange-2013/

Recover the deleted accounts from AD database
http://social.technet.microsoft.com/wiki/contents/articles/5549.recover-active-directory-deleted-items-using-ldp-exe.aspx
https://technet.microsoft.com/en-us/library/dd379509(v=ws.10).aspx

Then connect the mailbox to the recovered AD users
https://technet.microsoft.com/en-us/library/bb123490(v=exchg.141).aspx
https://technet.microsoft.com/en-us/library/jj863439(v=exchg.150).aspx
0
 

Author Comment

by:GospodinRasputin
ID: 41737225
Hi MAS,
Are you saying that though I used remove and not disable, that the mailboxes are still only disconnected and they can still be gotten back by issuing the Clean-MailboxDatabase commandlet???

Yes, I carried out the removal on a Exchange 2013.
Thanks
0
 

Author Comment

by:GospodinRasputin
ID: 41737227
Also, in your first link above, it says that Update-StoreMailboxState attempts to "to synchronize the mailbox state for a mailbox in the Exchange mailbox store with the state of the corresponding Active Directory user account". In my case, the AD accounts were also removed so there would be nothing to synchronize with.

Please clarify. Thank you
GospodinR
0
 
LVL 24

Expert Comment

by:-MAS
ID: 41737242
This expert suggested creating a Gigs project.
If you delete a user your mailbox still exists in your mailbox server.

if you just want mails. you can restore that mails by connecting that mailbox to another user.
Explained here
https://technet.microsoft.com/en-us/library/jj863439(v=exchg.150).aspx
https://www.youtube.com/watch?v=hwEiK_DS0xU
Check this video

Thanks
0
 

Author Comment

by:GospodinRasputin
ID: 41737245
Sorry you misunderstood me.
By using the remove commandlet on Exchange 2013, i delete both the mailbox and the user account from AD.

I did not simply delete my user account from AD.
Thanks
0
 
LVL 24

Expert Comment

by:-MAS
ID: 41737297
Remove-Mailbox -Identity mymailbox -Permanent $true
This command will delete the mailbox permanently
If you dont use this "-permanent" switch your mailbox will retain for 30days by default.

if you want immediately show the disconnected mailboxes run the below command.
Get-MailboxStatistics -Database database1 | Where { $_.DisconnectReason -ne $null } | ForEach { Update-StoreMailboxState -Database $_.Database -Identity $_.MailboxGuid -Confirm:$false }

Open in new window

Change the database name

Thanks
0

Join & Write a Comment

Suggested Solutions

ADCs have gained traction within the last decade, largely due to increased demand for legacy load balancing appliances to handle more advanced application delivery requirements and improve application performance.
This process describes the steps required to Import and Export data from and to .pst files using Exchange 2010. We can use these steps to export data from a user to a .pst file, import data back to the same or a different user, or even import data t…
In this video we show how to create an Accepted Domain 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 Mail Flow >> Ac…
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles from a Windows Server 2008 domain controller to a Windows Server 2012 domain controlle…

747 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now