Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
destank
Microsoft Employee
Microsoft Employee

Cannot create subfolder with $Proxy.CreateFolder

Hi all,

 

I am working on automatization of some administrative tasks like creating folders for users that want to have their own space on premise server and specifying appropriate permissions on the folder. Using PowerShell scripts $Proxy.CreateFolder($FolderName, $RsFolder, $null) | Out-Null.
This script works only if I am creating folders on the root of the server ($RsFolder = '/'
If I want to create a folder as a sub folder of another folder this script does not work. ($RsFolder = '/USERS/' $FolderName='John'). USERS folder exists on the root of the server.


I am getting following error: 

Exception occurred while creating folder! Exception calling "CreateFolder" with "3" argument(s):
"System.Web.Services.Protocols.SoapException: The path of the item '/USERS/' is not valid. The full path must be less than
260 characters long; other restrictions apply. If the report server is in native mode, the path must start with slash. --->
Microsoft.ReportingServices.Diagnostics.Utilities.InvalidItemPathException: The path of the item '/USERS/' is not valid.
The full path must be less than 260 characters long; other restrictions apply. If the report server is in native mode, the
path must start with slash.
at Microsoft.ReportingServices.Library.ReportingService2010Impl.CreateFolder(String Folder, String Parent, Property[]
Properties, CatalogItem& ItemInfo)
at Microsoft.ReportingServices.WebServer.ReportingService2010.CreateFolder(String Folder, String Parent, Property[]
Properties, CatalogItem& ItemInfo)"
At C:\PowerBI\Tools\ReportingServicesTools-master\ReportingServicesTools\Functions\CatalogItems\New-RsFolder.ps1:88 char:13
+ throw (New-Object System.Exception("Exception occurred while creatin ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (:) [], Exception
+ FullyQualifiedErrorId : Exception occurred while creating folder! Exception calling "CreateFolder" with "3" argument(
s): "System.Web.Services.Protocols.SoapException: The path of the item '/USERS/' is not valid. The full path must be le
ss than 260 characters long; other restrictions apply. If the report server is in native mode, the path must start with
slash. ---> Microsoft.ReportingServices.Diagnostics.Utilities.InvalidItemPathException: The path of the item '/USERS/'
is not valid. The full path must be less than 260 characters long; other restrictions apply. If the report server is i
n native mode, the path must start with slash.
at Microsoft.ReportingServices.Library.ReportingService2010Impl.CreateFolder(String Folder, String Parent, Property[
] Properties, CatalogItem& ItemInfo)
at Microsoft.ReportingServices.WebServer.ReportingService2010.CreateFolder(String Folder, String Parent, Property[]
Properties, CatalogItem& ItemInfo)"

 

Any idea why?

 

thanks in  advance

 

Dejan

1 ACCEPTED SOLUTION
jtarquino
Microsoft Employee
Microsoft Employee

Are you using /users for the Path parameter (without the slash at the end)?

 

We have a unit tests that validates that scenario , you can use it as a example (check the test Context "Create a subfolder")

https://github.com/Microsoft/ReportingServicesTools/blob/master/Tests/CatalogItems/New-RsFolder.Test...

View solution in original post

3 REPLIES 3
jtarquino
Microsoft Employee
Microsoft Employee

Are you using /users for the Path parameter (without the slash at the end)?

 

We have a unit tests that validates that scenario , you can use it as a example (check the test Context "Create a subfolder")

https://github.com/Microsoft/ReportingServicesTools/blob/master/Tests/CatalogItems/New-RsFolder.Test...

Thanks jtarquino,

 

i was assigning '/' programaticaly to the end of the path in my code - that was the reason it didn't work for me.

 

Regards

 

Dejan 

v-qiuyu-msft
Community Support
Community Support

@mgmeyer@jtarquino Do you have ideas about this issue? I don't have much knowledge about developer section. 

 

Best Regards,
Qiuyun Yu 

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.