How to assign a role to all users

DevtoSME
Giga Guru

We have created a module for all employees to submit their updated resumes to. In order for all employees to view this module I need to create a role for the module and then assigned it to all employees (197)

 

Should i create a role and add it to a group or is only a role needed.

Also

 

What is the best way to distribute the role to all employees (not manually) 

2 ACCEPTED SOLUTIONS

You can run the below script in System Definition > Scripts - Background

 

var grUser = new GlideRecord("sys_user");
grUser.addActiveQuery(); // Get only active users
grUser.query();
while(grUser.next()){
	var grMember = new GlideRecord('sys_user_grmember');
	grMember.initialize();
	grMember.group = "sys_id of the group created";
	grMember.user = grUser.sys_id;
	grMember.insert();
}

 

Thank you,
Palani

View solution in original post

ok,

im trying it out now

 

View solution in original post

5 REPLIES 5

i ran it and it worked in scripts background thank you!

 

 last question and excuse my ignorance but  where do i apply this script too....  the group itself or to the module?