cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
destank Frequent Visitor
Frequent Visitor

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: (Smiley Happy [], 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

Accepted Solutions
Power BI Team jtarquino
Power BI Team

Re: Cannot create subfolder with $Proxy.CreateFolder

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...

3 REPLIES 3
Moderator v-qiuyu-msft
Moderator

Re: Cannot create subfolder with $Proxy.CreateFolder

@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.
Power BI Team jtarquino
Power BI Team

Re: Cannot create subfolder with $Proxy.CreateFolder

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...

destank Frequent Visitor
Frequent Visitor

Re: Cannot create subfolder with $Proxy.CreateFolder

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