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
Brani
Frequent Visitor

Remove leavers/users in SQL possible?

Hi all

We're cleaning up our licenses and i found a bunch of users, that have still a role assigned but do not work anymore in our company. 

What did I do? I ran this query, this gave me all the users that are somehow on the Database. 

select u.UserName, r.RoleName, r.Description, c.Path, c.Name
from dbo.PolicyUserRole pur
inner join dbo.Users u on pur.UserID = u.UserID
inner join dbo.Roles r on pur.RoleID = r.RoleID
inner join dbo.Catalog c on pur.PolicyID = c.PolicyID
order by u.UserName

 

A couple of them are not anymore working. 

Is there a way to remove this users via another query or have i to remove them manually from the Power BI Frontend?

Many thanks

Brani

1 ACCEPTED SOLUTION
josef78
Memorable Member
Memorable Member

1) Remove user permission from reports (of folders) is not necesenary, if these peoples not working in company, then (I hope) their AD acccount are disabled or removed, and they cannot access.

 

2) Any modification in ReportServer database is not recommended, and not supported.

 

You can remove old users manually from GUI, or you can remove using REST API.

View solution in original post

7 REPLIES 7
lbendlin
Super User
Super User

Remove them from where?

Hi  @lbendlin 

From the Database "ReportServer". The default DB.

Best Regards
Brani

josef78
Memorable Member
Memorable Member

1) Remove user permission from reports (of folders) is not necesenary, if these peoples not working in company, then (I hope) their AD acccount are disabled or removed, and they cannot access.

 

2) Any modification in ReportServer database is not recommended, and not supported.

 

You can remove old users manually from GUI, or you can remove using REST API.

Brani
Frequent Visitor

Hi josef78

Thanks for your reply. 

Users are removed from AD, but we keep track of leavers. But they are still counted in the "Roles", i.e. "contant manager" etc. 
So the solution is GUI or REST API 👍

Many thanks / Beste Grüsse

Brani

That's something you will want to do in the database. Data write back features in Power BI are pretty much non-existent.

Hi  @lbendlin 

That was my question 🙂 do you know how to do it?

You can run an Update or Delete query the same way you ran your Select query.  In fact, it is considered good practice to create the Select query first so you will know how many rows will be affected by the destructive operations.

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.

Top Solution Authors