Unable to export all public folder permissions to .CSV

%3CLINGO-SUB%20id%3D%22lingo-sub-3198431%22%20slang%3D%22en-US%22%3EUnable%20to%20export%20all%20public%20folder%20permissions%20to%20.CSV%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3198431%22%20slang%3D%22en-US%22%3E%3CP%3EHello%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI've%20been%20trying%20to%20export%20a%20list%20of%20every%20single%20public%20folder%20user's%20permission%20to%20a%20csv%20file.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIts%20successful%20when%20I%20use%20%3A%26nbsp%3B%20get-publicfolder%20-recurse%20%7C%20get-publicfolderclientpermissions%20%7C%20export-csv%20XXX%3C%2FP%3E%3CP%3E%2C%20however%20it%20does%20only%20return%20about%2010000%20entries.%20If%20I%20add%26nbsp%3B%20resultsize%20-unlimited%20to%20the%20above%20script%20it%20returns%20nothing%20-%20the%20csv%20file%20is%20completely%20blank.%20Any%20ideas%3F%20I%20also%20need%20to%20get%20a%20list%20of%20permissions%20to%20all%20public%20folders%20for%20a%20single%20user%20(%20we've%20about%201000%20of%20them%20in%20our%20env%20and%20user%20would%20like%20to%20know%20to%20which%20folders%20he%20has%20an%20access%20to).%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIn%20addition%20it%20does%20return%20the%20below%20error%20now%3A%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22SANDS.PNG%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F350320i280FA12E06610AF6%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22SANDS.PNG%22%20alt%3D%22SANDS.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-3198431%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExchange%20Online%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EPowerShell%20CMDLETS%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EPublic%20Folder%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3199803%22%20slang%3D%22en-US%22%3ERe%3A%20Unable%20to%20export%20all%20public%20folder%20permissions%20to%20.CSV%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3199803%22%20slang%3D%22en-US%22%3EIf%20you%20are%20only%20interested%20in%20getting%20the%20permissions%20for%20a%20single%20user%2C%20use%20the%20following%20format%3A%3CBR%20%2F%3E%3CBR%20%2F%3EGet-PublicFolder%20-Recurse%20%7C%20Get-PublicFolderClientPermission%20-User%20vasil%3CBR%20%2F%3E%3CBR%20%2F%3EMight%20want%20to%20check%20any%20Default%20entries%20too%2C%20I%20suppose.%20And%20add%20the%20-ResultSize%20switch.%20Or%20better%20yet%2C%20use%20a%20full-blown%20script%20instead%20of%20one-liner.%3C%2FLINGO-BODY%3E
New Contributor

Hello,

 

I've been trying to export a list of every single public folder user's permission to a csv file.

 

Its successful when I use :  get-publicfolder -recurse | get-publicfolderclientpermissions | export-csv XXX

, however it does only return about 10000 entries. If I add  resultsize -unlimited to the above script it returns nothing - the csv file is completely blank. Any ideas? I also need to get a list of permissions to all public folders for a single user ( we've about 1000 of them in our env and user would like to know to which folders he has an access to).

 

In addition it does return the below error now: 

 

SANDS.PNG

 

3 Replies
If you are only interested in getting the permissions for a single user, use the following format:

Get-PublicFolder -Recurse | Get-PublicFolderClientPermission -User vasil

Might want to check any Default entries too, I suppose. And add the -ResultSize switch. Or better yet, use a full-blown script instead of one-liner.

@Vasil Michev thanks but I've already tried that and it doesn't work. No matter what I add to the script it keeps returning that error:

 

PublicfolderX.PNG

That's why I mentioned that you'd be better off running a full-blown script instead of using the pipeline. Get a list of all the PFs, iterate over them and check the permissions, catch any errors and add proper handling to continue in the event of session disconnect.