To remove the last public folder database from an organization, perform the following steps:
1- Verify that there is no OAB are configured for Public folder distribution as below
2- Remove all Public Folders from Public Folder Database as below
a- Use Power shell to delete user public folders
Get-PublicFolder -Server <server containing the public folder database> “\” -Recurse -ResultSize:Unlimited | Remove-PublicFolder -Server <server containing the public folder database> -Recurse -ErrorAction:SilentlyContinue
b- Use Power shell to delete System Public Folders
Get-PublicFolder -Server <server containing the public folder database> “\Non_Ipm_Subtree” -Recurse -ResultSize:Unlimited | Remove-PublicFolder -Server <server containing the public folder database> -Recurse -ErrorAction:SilentlyContinue
3- Remove the Last Public Folder Database using Power shell
a- Remove-PublicFolderDatabase -Identity “PFDB01”
b- A message appears asking you to confirm that you want to perform this action. Enter Y
c- A warning appears, indicating that the database was removed and reminding you to manually remove the database file. The default location for these files is <Exchange installation path\v14\Mailbox\<public folder database name>.
4- Delete the Public folder Database files manually
When you remove a public folder database, the Exchange database (.edb) file for the database and other files associated with the database aren’t automatically deleted. You must delete the public folder database files manually. The default location for these files on an Exchange 2010 server is <Exchange installation path>\v14\Mailbox\<public folder database name>. The default location for these files on an Exchange 2007 server is C:\Program Files\Microsoft\ExchangeServer\Mailbox\<storage group name>\<public folder database name>.