# Reset User Source Script

**URL:** <https://forum.inductiveautomation.com/t/reset-user-source-script/65403>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [October 19, 2022, 2:33pm UTC](https://forum.inductiveautomation.com/t/reset-user-source-script/65403 "2022-10-19T14:33:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jacob.ramirez](https://avatars.discourse-cdn.com/v4/letter/j/9dc877/32.png) [@jacob.ramirez](https://forum.inductiveautomation.com/u/jacob.ramirez)\
**Post date:** [October 19, 2022, 2:33pm UTC](https://forum.inductiveautomation.com/t/reset-user-source-script/65403/1 "2022-10-19T14:33:16Z")

</div>

Is there any way to reset a User source without going into the gateway by using a script? I'm not sure if this is the issue I'm having but when creating a user from a Perspective session the user tries to log in afterward and fails. After some time it works (not sure how long, approx. 10 - 20 min).

I don't know if resetting the user source fixes or causes it to pull the users from the database (I use a database user source), allowing them to log in.

---

<div class="post-metadata">

**Author:** ![Joe\_Seph](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/joe_seph/32/40277_2.png) [@Joe\_Seph](https://forum.inductiveautomation.com/u/Joe_Seph)\
**Post date:** [October 31, 2022, 8:53pm UTC](https://forum.inductiveautomation.com/t/reset-user-source-script/65403/2 "2022-10-31T20:53:52Z")

</div>

Hi Jacob, how are you creating new users in your session? Is the database updating as expected? Unfortunately there is not a way to perform an edit/save on a user source via scripting.

---

<div class="post-metadata">

**Author:** ![jacob.ramirez](https://avatars.discourse-cdn.com/v4/letter/j/9dc877/32.png) [@jacob.ramirez](https://forum.inductiveautomation.com/u/jacob.ramirez)\
**Post date:** [November 1, 2022, 8:28pm UTC](https://forum.inductiveautomation.com/t/reset-user-source-script/65403/3 "2022-11-01T20:28:21Z")

</div>

The database is updating as expected. I am creating a user object using the `user_object = system.user.getNewUser(user_source, "username")` function, then setting values for other credentials for the user object. Then at the end of all that I call `system.user.addUser(user_source, user_object)` function.

---

<div class="post-metadata">

**Author:** ![Joe\_Seph](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/joe_seph/32/40277_2.png) [@Joe\_Seph](https://forum.inductiveautomation.com/u/Joe_Seph)\
**Post date:** [November 1, 2022, 9:32pm UTC](https://forum.inductiveautomation.com/t/reset-user-source-script/65403/4 "2022-11-01T21:32:23Z")

</div>

Please reach out to the IA support department and make a ticket so we can take a closer look at this.  
[https://www.inductiveautomation.com/support/home/](https://www.inductiveautomation.com/support/home/)
