- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-21-2016 10:20 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-22-2016 01:55 AM
Hi munimohan,
var usr = new GlideRecord('sys_user');
usr.initialize();
usr.first_name= 'Prashant';
usr.last_name = 'Kumar';
user.insert();
Mark answer as correct if it satisfies.....
Cheers,
Prashant
Please appreciate the efforts of community contributors by marking the appropriate response as the correct answer and helpful. This may help other community users to follow the correct solution in the future.
********************************************************************************************************
Cheers,
Prashant Kumar
ServiceNow Technical Architect
Community Profile LinkedIn YouTube Medium TopMate
********************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-22-2016 01:55 AM
Hi munimohan,
var usr = new GlideRecord('sys_user');
usr.initialize();
usr.first_name= 'Prashant';
usr.last_name = 'Kumar';
user.insert();
Mark answer as correct if it satisfies.....
Cheers,
Prashant
Please appreciate the efforts of community contributors by marking the appropriate response as the correct answer and helpful. This may help other community users to follow the correct solution in the future.
********************************************************************************************************
Cheers,
Prashant Kumar
ServiceNow Technical Architect
Community Profile LinkedIn YouTube Medium TopMate
********************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-21-2019 01:45 AM
Hi Prashant,
Can you give me code(background script) for creating multiple users.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-22-2016 01:57 AM
Hi,
Use insert() or initialize() function to create new record on sys_user table and set the required fields like user_name, first_name, last_name etc. (just FYI you need security_admin role to run background script).
var newUser= new GlideRecord('sys_user');
newUser.initialize();
newUser.first_name= 'name';
newUser.last_name = 'lastname';
newUser.user_name = 'empID';
newUser.insert();
Mark Correct if it solved your issue or hit Like and Helpful if you find my response worthy.
Thanks,
Deepa
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-21-2019 01:46 AM
Hi Deepa,
Can you give me code(background script) for creating multiple users .