New-PublicFolderDatabaseRepairRequest – Detect & Repair Public Folder Database

A Public Folder in Exchange is a great way to have public data like contacts and calendars and other folder types to share common information with various users depending on their permission level. A public folder works like a mailbox as it can receive emails as it is assigned an SMTP address on creation which can be used for centralizing email delivery for certain groups. Creating a Public Folder is easy and it works like an Exchange Mailbox Database by using an EDB file corresponding to the name during creation.

A Public Folder can get corrupted as a Mailbox Database file and it can be caused by a number of factors. An unexpected power outage of the server or host, a shutdown during an email restore, a bad sector in the hard drive or malicious programs such as viruses or malware that corrupt the database itself. One of the things that show when such issues occur is that users will complain that they cannot access the data and when looking at the Exchange Management Console you see that the database is not mounted.

With Exchange 2010 SP2 or more, you can put the ISInteg tool aside as one can use the New-PublicFolderDatabaseRepairRequest which is a command to detect and repair replication issues with a public folder database. Before running this PowerShell command you might need to know some things before.

Once the Public Folder repair has been started, the process cannot be stopped unless you dismount the Public Folder. Of course dismounting the Public Folder during a repair process can cause some repercussions and maybe damage the database even more.

During the process of the Repair request other databases will be accessible but the current database being repaired will be locked by the process and hence not available to the admins and general public.

You start off by setting the right permissions to the user which will be used to run the process.You would need to form part of the following groups

  1. Organization Management
  2. Recipient Management
  3. Server Management

Once you assign the groups and try to run the command, if you still get an access denied you need to wait about an hour or two until the group membership is committed. To check if the membership to the groups is now effective, you can use the whoami command or the gpresults. You can run the whoami /groups and it will list all the groups that the logged in user is a member of. If you run gresults /v you will get a lot of information about the user but look for the part where it says The user is a part of the following security groups.

You can run the whoami /groups and it will list all the groups that the logged in user is a member of.

If you run gresults /v you will get a lot of information about the user but look for the part where it says The user is a part of the following security groups.

Once this is done the below is the full syntax of the New-PublicFolderDatabaseRepairRequest

Let’s go through some parameters and how these can be used in the cmdlet.

CorruptionType

This is required for the command to run and the parameter specifies the type of corruption which you would want to detect and repair. The value should be

Database

Here you would need to specify which database you would need to run the command against by using the database GUID or the database name.

Confirm

The confirm switch is used to automated the confirmation prompt that appears by default when the command is executed. The syntax is

DetectOnly

This parameter is used if you want to just run a diagnostics of the database without actually fixing it. You don’t have to specify any additional entries and all you need to add to the line is

DomainContoller

This parameter is used only if you wish to choose a specific domain controller which can write the configuration changes to the Active Directory. This parameter is mostly used if you have a Read Only Domain Controller (RODC) in your site. The full FQDN of the server would be needed example/p>

WhatIf

The WhatIf is a switch which is used when running the command to simulate the actions that you have chosen in the line of command. By using this switch you can view the changes that would occur without having to apply the changes. There is nothing to specify for this as you just need to add –WhatIf to the line.

On the other hand, instead of going through all this process and still ending up with no success at all of course depending on the damage, one can look into alternative to the native tools as if you don’t manage to fix the database of the Public Folder, natively there is no way to export the data from it; apart from taking less time and less administrative effort.

Stellar Repair for Exchange can instantly connect to any EDB file being a mailbox database or a public folder. This Exchange Recovery Software is fast and reliable in scanning the file and has a great graphical user interface to browse through the public folder. You can see the data live like mails, calendars, contacts and tasks and export them accordingly. You can export to PST, MSG, EML, HTML, RTF and PDF. It can also export directly to live Exchange Servers and Office 365 tenants. You can make a granular export, date range and various other criteria. It supports any Exchange Server from 5.5 to 2019.