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

Posted on 2012-09-14
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
    LVL 16

    Expert Comment

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

    Author Comment

    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

    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 $ or $Folder.fullpath

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

    Good luck!


    Author Comment

    Will check this and let you know.

    Author Comment

    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

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    Exchange server is not supported in any cloud-hosted platform (other than Azure with Azure Premium Storage).
    Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
    In this video we show how to create an email address policy in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.:  First we need to log into the Exchange Admin Center. Navigate to the Mail Flow…
    This video discusses moving either the default database or any database to a new volume.

    734 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

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now