Stop direct access to employee service center

Kohei4
Giga Expert

Hello, 

I need your help because I have to avoid to create unnecessary HR profile not to breach my company's license counts.

This is the situation.
We employee login to the servicenow service portal and then click an icon to move on to the employee service center.
The icon is shown to employees who has HR profile.
Some employee directry access to the employee service center URL who don't have HR profile and should not access to them.
By accessing to the ESC, HR profile is created (This is OOTB in my understanding)

Is there any solution?

10 REPLIES 10

Community Alums
Not applicable

Hi Kohei,

This article will help you to understand :https://community.servicenow.com/community?id=community_blog&sys_id=ba528ba5dbd344106064eeb5ca9619bf

Mark my answer correct & Helpful, if Applicable.

Thanks,
Sandeep

Community Alums
Not applicable

Hi Kohei,

Any update to this ?Any follow-up required? if not

Kindly mark the answer as Correct & Helpful both such that others can get help.

Thanks,
Sandeep

michaelj_sherid
ServiceNow Employee
ServiceNow Employee

Hi @Kohei This is older code that creates the HR Profile when a user logs into the ESC. There is a server script in the ESC Header that creates the HR Profile.   The code looks something like the example below. You will just need to comment out that portion that creates the HR Profile.

 if(new GlidePluginManager().isActive("com.sn_hr_core")) {

data.isHrCoreActive = true;

 

// HR Profile

var hrProfileGr = new GlideRecord('sn_hr_core_profile');

hrProfileGr.addQuery('user', gs.getUserID());

hrProfileGr.setLimit(1);

hrProfileGr.query();

if (!hrProfileGr.next()) {

hrProfileGr.setValue('user', gs.getUserID());

hrProfileGr.insert();

}

}

 

Regards,

Mike

Thanks, Sheridan

Could you please where the script is?
I could not find it

From your portal record, go to the Theme > Header. The code is located in the Server Script section of the header widget.

find_real_file.png