Populate the “folder path” field for mail-enabled public folders in the address book

If you’re like me you hate when you get a request from a user to modify something with a mail-enabled public folder because users NEVER tell you the path to that folder in the folder hierarchy.  You can find it via powershell if you want:

Get-MailPublicFolder “smtp@address” | Get-PublicFolder | fl Name, ParentPath

Name    : Folder Name
ParentPath : Parent Folder NameSub folder name

If you look in the address book, each mail-enabled public folder in the list has a “folder path” property that never gets populated.  I wish I knew why Microsoft made this information available but didn’t make it easy to populate the values – you’d think it would just automatically be able to look that information up when it generates the address list – but sadly, NO!

Or you could run a powershell script to set each one of them automatically.  You’ll have to schedule the script to run regularly to make sure the values are up to date though.  You’ll also need the Quest ActiveRoles snapin for powershell. 

Here’s the script I wrote to accomplish this:

$mailpub = Get-MailPublicFolder -ResultSize unlimited
foreach ($folder in $mailpub) {
 $pubfolder = Get-PublicFolder -Identity $folder
 $folderpath = $pubfolder.parentpath + “” + $pubfolder.name
 $qadpub = Get-QADObject -IncludeAllProperties -Type publicfolder -Identity $folder
 Set-QADObject -Identity $qadpub -ObjectAttributes @{folderPathname=$folderpath}}


Have fun!