locked
The request failed with HTTP status 401: Unauthorized on SSRS 2012 (SP3) RRS feed

  • Question

  • I have a windows service that maintains our reporting environment that uses .net 4.5.  I recently upgraded the web reference from ReportService2005 to ReportService2010.  When I run it in debug mode as the local\administrator I get no errors but when I compile the service and run it with the local\administrator as the "log on" for the service I get the unauthorized exception.  The builtin\administrator, local\administrator, and nt authority\system users have full rights to the server.  The following is an extract of the code I'm using to create folders on the server. Can anyone help me with this issue?  

    Dim ssrs as New clsSQLServerReports

    ssrs.CreateStructure

    Public Class clsSQLServerReports Public Exception As Exception = Nothing Private myReportService As New ReportService2010.ReportingService2010 Private myCatalogItems As ReportService2010.CatalogItem() Private SQLReportsLocation As String = String.Empty Public Sub New() Try myReportService.Credentials = System.Net.CredentialCache.DefaultCredentials LoadSQLReportsLocation() Catch ex As Exception Exception = ex modGlobal.LogEvent(current_instance.CompanyID, ex.ToString) End Try End Sub Public Sub CreateStructure() Try Dim mySearchConditions(0) As ReportService2010.SearchCondition Dim temp_path As String = SQLReportsLocation If temp_path.StartsWith("/") Then temp_path = temp_path.Substring(1) End If If temp_path.Contains("/") Then Dim path() As String = temp_path.Split(CChar("/")) Dim parent_folder As String = "/" For x As Integer = 0 To path.Length - 1 mySearchConditions(0) = New ReportService2010.SearchCondition With mySearchConditions(0) .Condition = ReportService2010.ConditionEnum.Equals .ConditionSpecified = True .Name = "Name" Dim values() As String = {path(x)} .Values = values End With myCatalogItems = myReportService.FindItems(parent_folder, Nothing, Nothing, mySearchConditions) If myCatalogItems Is Nothing Then myReportService.CreateFolder(path(x), parent_folder, Nothing) ElseIf myCatalogItems.Count = 0 Then myReportService.CreateFolder(path(x), parent_folder, Nothing) End If If parent_folder.Length = 1 Then parent_folder += path(x) Else parent_folder += "/" & path(x) End If Next Else mySearchConditions(0) = New ReportService2010.SearchCondition mySearchConditions(0).Name = "Name" Dim values() As String = {temp_path} mySearchConditions(0).Values = values myCatalogItems = myReportService.FindItems("/", Nothing, Nothing, mySearchConditions) If myCatalogItems Is Nothing Then myReportService.CreateFolder(temp_path, "/", Nothing) ElseIf myCatalogItems.Count = 0 Then myReportService.CreateFolder(temp_path, "/", Nothing) End If End If Catch ex As Exception Exception = ex LogEvent(current_instance.CompanyID, ex.ToString) End Try End Sub End Class



    Friday, February 26, 2016 8:34 PM

All replies

  • 1). When you run the code in the debug mode, which user credential is returned with this line: myReportService.Credentials ?

    2). Once you log on the SSRS with the local admin account, are you be able to create folder directly on the report manager site? 


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, February 29, 2016 10:14 AM
  • 1)  I set a break point on the line following the creation of the credentials object and the credentials object reports the following -

    MyReportService.Credentials.Domain = ""

    MyReportService.Credentials.UserName = ""

    2) Yes, I can create folders from the root (home) when logged in as the local administrator, ie. [computer name]\administrator


    • Edited by jwbutler123 Monday, February 29, 2016 2:49 PM
    Monday, February 29, 2016 2:48 PM
  • Hi, 

    Did you ever receive a fix for this. I'm in a similar situation.  Any help would be appreciated.

    Thanks,

    Peter

    Friday, May 17, 2019 7:10 PM