Ask Search:
Roberto RiglioneRoberto Riglione 

SOQL Query

Hello all, I`m trying to get a SOQL query to help me find ALL permission sets that are assigned to INACTIVE users, in order to unassign by using mass delete possibly with DL or Workbench. Please if you could help that would be great. Thanks in advance.
Best Answer chosen by Roberto Riglione
Girish NallamothuGirish Nallamothu
Hello ,
Please try this 

SELECT Id, 
       AssigneeId,Assignee.Name,
       PermissionSet.Name 
 FROM PermissionSetAssignment 
 WHERE Assignee.isActive = false order by Assignee.Name

All Answers

Kavya GKavya G
Try this in Workbench

SELECT PermissionSet.Name, AssigneeId, Assignee.Name FROM PermissionSetAssignment where Assignee.IsActive = False
Girish NallamothuGirish Nallamothu
Hello ,
Please try this 

SELECT Id, 
       AssigneeId,Assignee.Name,
       PermissionSet.Name 
 FROM PermissionSetAssignment 
 WHERE Assignee.isActive = false order by Assignee.Name
This was selected as the best answer
Roberto RiglioneRoberto Riglione
Many thanks Girish, this has worked for me thanks again.