If I need to perform a procedure on an Exchange public folder, such as changing permissions, but I don't have the full path to the public folder (which is required in the -identity parameter for most public folder commands), how do I get that full path?
Some resources I have found have suggested using the powershell get-publicfolder -recurse
and filtering the results, but in a large organization with thousands of public folders that command can take hours, if it finishes at all.
I've run into this a number of times and it's been frustrating. More often than not, I wind up harassing a user who connects to that folder in order to get the full path from them. Once or twice I've just let it go and said "I can't do it without the full path".
But it turns out that
get-recipient
does not require the full path in order to return a result.And
get-publicfolder
accepts pipeline input. So you can retrieve the parent path of a public folder (such as "\Parent\Path\myPublicFolder") with the following command:I have tested and this works whether the public folder is mail-enabled or not. If multiple public folders match your get-recipient results, then this pipeline will return the parent path for all of them.
I thought I'd share, just in case anyone else runs into the same frustration. This works on Exchange 2010.
This does not work in Exchange 2013 or later. As of this writing (Aug 2019), there does not appear to be any other way to easily retrieve the path of a public folder without filtering the
get-publicfolder -recurse
cmdlet.In PowerShell:
It's even more simple if you do this:
The output will look something like this:
Use this
Get-PublicFolder -Recurse -ResultSize unlimited | where name -match "publicfoldername"
It's not working for me. For me it's working when I use this command: