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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.