Many times, we come across scenarios where we need to assign all the users in a "Public Group" with a specific "Permission Set". Looks like a genuine & monotonous problem right? Well, yes it is right as you need to add the users one-by-one or by using the great app-exchange product "The Permissioner". What can be irritating is, when there are different users whose usernames are starting with different letters and suddenly the app crashes. Frustrating AF.!!!!!!!!
To put an end to this problem, let me share with you a simple technique that can actually take away all the nightmares of such problems from you.
"Data-Loader" - A very simple, yet very powerful tool that is actually what your savior is. Wanna know more about 'HOW'? Read On!!!
Let us assume, the group whose users you would like to assign a specific permission set to be "My Group" with the ID "00G0O000001fMc0UAE"
The permission set that we want to assign - "My Permission" - ID ="0PS20000000Wf2V"
Step 1: Find out all the users who are present in the Group and export the details in the CSV file. Use the below query:
--> SELECT GroupId,UserOrGroupId FROM GroupMember WHERE GroupId = '00G0O000001fMc0UAE'
Step 2:-->Open Dataloader
Step 3:--> Insert Operation
Step 4:--> Select the object --> "PermissionSetAssignment"
Step 5:--> Create the CSV. --> To create this, open the CSV file that you exported, replace the column with the header "GroupId", Change the values in this column by replacing the ID's of Group with the ID's of the permission set. Here for our example, we need to change "00G0O000001fMc0UAE" to "0PS20000000Wf2V" and hit the save button.
Step 6:--> Upload the new CSV file, do the mapping and run the operation.
Bingo..!!! You have successfully assigned 1 permission set to 1000+ users in merely 5 mins.
What are your takes on the above technique? Have something better, do share in the comment section below and feel free to let me know your observations or post in any comments that you might have..!!
Enjoy! Happy Salesforce Days!!
Comments
Post a Comment