Need powershell command / script to get folder permissions for parent and nested public folders.

Posted on 2012-09-14
Medium Priority
Last Modified: 2012-09-28
I am working on task of drawing public folders permissions to csv file.
However when i try to run the powershell command it gives me output only for parent folder and not for sub folders.
I need command / script to get details of all sub folders recursively.
Any help will be appreciated.
Question by:ex_ad
  • 3
  • 2
LVL 16

Expert Comment

by:Dale Harris
ID: 38400154
Please post the script you're using and we'll be able to modify it for you.

Author Comment

ID: 38404884
Server Side : Get-PublicFolderItemStatistics -Identity "\Marketing\Reports" | Select Subject,LastModificationTime,HasAttachments,ItemType,MessageSize | Export-CSV C:\PFItemStats.csv

Client side : (Outlook 2007 )
“Get-PublicFolderClientPermission -Identity "\911" |Select user, Accessrights | Export-Csv C:\temp\PFPermissions1.csv “  

I guess we needto combine these two and create single one.
However any other options are welcome.
LVL 16

Accepted Solution

Dale Harris earned 2000 total points
ID: 38404917
You're going to want to get the folders into an array, then do the command to each folder:


$Folders = Get-PublicFolder -recurse -identity "\Marketing\Reports"
$RunningPermissionsList = @()
foreach ($Folder in $Folders){
$RunningPermissionsList += Get-PublicFolderItemStatistics -Identity $Folder | Select Subject,LastModificationTime,HasAttachments,ItemType,MessageSize
$RunningPermissionsList | Export-CSV C:\PFItemStats.csv

This should get you going in the right direction.

There might be two issues: the running permissions list variable may not act the way you want when it exports, so you can fix this by exporting into a text file with the >> command, which appends

Next issue might be when it attemps to get the folderitemstatistics.  You might need to do a property of the $Folder variable like $Folder.name or $Folder.fullpath

To see the available properties, you can do $Folder | gm

Good luck!


Author Comment

ID: 38404961
Will check this and let you know.

Author Comment

ID: 38440314
We have derived output as mentioned below.

Identity      User      AccessRights

AccessRights = Microsoft.Exchange.Data.MultiValuedProperty`1[Microsoft.Exchange.Management.MapiTasks.PublicFolderAccessRight]

However Accessrights column does not include details like Owner , publisher, editor..etc.
Please let us know if you have any suggestions

Featured Post

Free recovery tool for Microsoft Active Directory

Veeam Explorer for Microsoft Active Directory provides fast and reliable object-level recovery for Active Directory from a single-pass, agentless backup or storage snapshot — without the need to restore an entire virtual machine or use third-party tools.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A walk-through example of how to obtain and apply new DID phone numbers to your cloud PBX enabled users that are configured in Office 365. Whether you have 1, 10 or 100+ users in your tenant, it's quite easy to get them phone-enabled and making/rece…
Steps to fix error: “Couldn’t mount the database that you specified. Specified database: HU-DB; Error code: An Active Manager operation fail”
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Loops Section Overview
Suggested Courses

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question