Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Insert user data through power bi report database to access reports

Hi All,

 

I have installed one Power bi Report server in my local machine. While installation i configured the database name and can access the same database tables using SSMS.

 

We have one requirement here to access any power bi report server without asking authentication. To complete that we found like those user which is present in Power bi Security with System User Role permission can access the Power bi report without authentication.

To achieve this one we have verified the Power bi DB and found like Users and PolicyUserRole table is mapped with the power bi report server when add new user through UI.

 

We added the same user in both of the tables and found one miss of SID column in Users table. What we found here like SID is nothing but system machine key. That we added also. But still the inserted user is not exist in Power bi report server UI Security.

 

How could we achieve the same to complete it. If we are able to manage this then user can access reports without authentication.

 

Please suggest. It is an urgent task.

 

Thanks,

Vikash

  • Anonymous's avatar
    Anonymous
    6 years ago

    Hi d_gosbell,

     

    Thank you for the suggestion. I have gone through each documentation as you mentioned and finally able to set the new user with role. It works fine for the 1st user but when again i tried to add another user with same role then got below error:

     

    "A custom role cannot contain both system-level and non-system-level tasks in the same role definition. You must specify different roles for each category of tasks"

     

    Below is my code which i used so far.

     

     

    bool isPolicies = true;
                    ReportingService2010 rs = new ReportingService2010();
                    rs.Url = "http://<domainName>/ReportServer/ReportService2010.asmx";
                    rs.Credentials = System.Net.CredentialCache.DefaultCredentials;
                    var policies = rs.GetPolicies("/", out isPolicies);
                   
                    Role browserRole = new Role();
                    browserRole.Name = "System User";
                    Role[] r1 = new Role[1];
                    r1[0] = browserRole;
                    Policy po = new Policy();
                    po.GroupUserName = @"<domain>\<username>";
                    po.Roles = r1;
                    policies[0] = po;
                    rs.SetPolicies("/", policies);

     

    One more things i wanted to add here is suppose i added one user with some role and when again i am going to add some other user then in getPolicies i am getting the previously inserted user and his role instead of BuiltIN/Administrator.

     

    I tried to use my crednetials but in Policies getting the same user again.

    Please provide some suggestion based on the credentials should get only those related policies.

     

    Please suggest how do i fix this issue.

     

    Thanks,

    Vikash

11 Replies

  • So first off you should NEVER manually insert data into the underlying SQL database, this is not a supported way of adding users. You should either use the user interface through the PBIRS portal or use the powershell or REST apis. We typically do not add a lot of individual users, we normally get an AD group setup, then add that group to the portal, then you just add/remove people from the AD group to control access. If everyone in your organization should be able to access the reports you can even add one of the built-in groups like "Domain Users"

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi d_gosbell,

       

      Thank you for the suggestion.

       

      i have gone through the swagger api where all the api is mentioned and found one forums questions also to manager users using api. But did not get the specific way mentioned like what api url could you to insert user for the role so that he can access the Power bi reports without authentication?

       

      Please suggest me to get the api url with the steps so that i can use it accordingly.

       

      Thanks,

      Vikash