How to remove Exchange 2010 public folders

We are trying to decommission an exchange 2010 server and is trying to removing all of it Public Folders.  We have never used public folders except for testing on a Exchange 2000 or Exchange 2003 server but the consultants kept migrating  the public folder to the new server them each time we installed a new version of Exchange.  We deleted the OAD and all but one public folders using the Exchange console,  That last one gave an error.

This command is reporting that there are no replicas (that is is not true.)
Get-PublicFolder  -Recurse | ft name,parentpath,replicas

This command is showing that theexhange2016 databases.  What would they be using it for?  Ho w fix it?
-MailboxDatabase | ft name,publicfolderdatabase
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Todd NelsonSystems EngineerCommented:
Take a look at this reference ...

At a high level, I perform the following tasks...
  1. Disable/remove public folder references in OAB
  2. Dismount and remount PF database
  3. Remove all non-system PFs from database ... Get-PublicFolder -Server "SERVERNAME" "\" -Recurse -ResultSize Unlimited | Remove-PublicFolder -Server "SERVERNAME" -Recurse -ErrorAction:SilentlyContinue
  4. Remove all system PFs from database ... GetGet-PublicFolder -Server "SERVERNAME" "\Non_Ipm_Subtree" -Recurse -ResultSize Unlimited | Remove-PublicFolder -Server "SERVERNAME" -Recurse -ErrorAction:SilentlyContinue
  5. Remove database
  6. Delete physical files

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
masterofallAuthor Commented:
I had removed the OAB using the management console. Microsoft used the shell to removed the last user public folder then the shell  the adsiedit to remove the public folder database.  I am trying to find the exact commands.
masterofallAuthor Commented:
Troubleshooting steps :

      Moved the arbitration mailboxes on 2016 server.

Get-Mailbox -Arbitration | Set-Mailbox -Arbitration -Database "mailbox database 222222222"  
 (I replaced the exact name of the database with 22222222)

      2010 Server was  shutdown for 2 weeks therefore we know that the 2016 works fine by itself.
        Check all the mailboxes moved to 2016 server.
      Remove the mailbox database and public folder database from adsiedit.
      Run the uninstall command .

E:\Exchange\Bin> /m:uninstall.

      Reboot the server and check that mail flow working fine both internally and externally.
      Issue stand resolved.
Todd NelsonSystems EngineerCommented:
Sufficient guidance provided for resolution.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.