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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
destank
Employee
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
Employee
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
Employee
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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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