# Switching User Script

**URL:** <https://forum.inductiveautomation.com/t/switching-user-script/11934>\
**Category:** Ignition\
**Created:** [July 15, 2016, 12:42pm UTC](https://forum.inductiveautomation.com/t/switching-user-script/11934 "2016-07-15T12:42:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Csantaw](https://avatars.discourse-cdn.com/v4/letter/c/9de0a6/32.png) [@Csantaw](https://forum.inductiveautomation.com/u/Csantaw)\
**Post date:** [July 15, 2016, 12:42pm UTC](https://forum.inductiveautomation.com/t/switching-user-script/11934/1 "2016-07-15T12:42:29Z")

</div>

I am trying to switch users in the client via the system.security.switchuser script. I apply this script to an action performed event on a push button.

uname = event.source.parent.getComponent(“Username”).text

pwd = event.source.parent.getComponent(“Password”).text

success= system.security.switchUser(uname,pwd,event)

if not success:

event.source.parent.getComponent(“Username”).requestFocusInWindow()

this is the example code snippet from the online manual. The runtime seems to lock up when I press the button. the system console on the gateway says it is removing tags due to switching user. the client remains frozen for about 4-5 minutes then closes on its own.

any help would be greatly appreciated.

---

<div class="post-metadata">

**Author:** ![Csantaw](https://avatars.discourse-cdn.com/v4/letter/c/9de0a6/32.png) [@Csantaw](https://forum.inductiveautomation.com/u/Csantaw)\
**Post date:** [July 15, 2016, 7:29pm UTC](https://forum.inductiveautomation.com/t/switching-user-script/11934/2 "2016-07-15T19:29:49Z")

</div>

I’ve dug around in my application and I have found these 2 “invalid action adapter found on group. removing” text lines in my java console when I startup my client. I believe this may be causing the hangup on logging out / switching users in my client. I am running version 7.8. I have tested my switch user and logout on an empty application and it preforms almost instantly. I have attached a picture of the java console.

---

<div class="post-metadata">

**Author:** ![andrews](https://avatars.discourse-cdn.com/v4/letter/a/898d66/32.png) [@andrews](https://forum.inductiveautomation.com/u/andrews)\
**Post date:** [July 12, 2021, 2:37pm UTC](https://forum.inductiveautomation.com/t/switching-user-script/11934/3 "2021-07-12T14:37:23Z")

</div>

did you ever figure it out
