# Change user password via script

**URL:** <https://forum.inductiveautomation.com/t/change-user-password-via-script/100874>\
**Category:** Ignition\
**Tags:** vision\
**Created:** [January 14, 2025, 6:07pm UTC](https://forum.inductiveautomation.com/t/change-user-password-via-script/100874 "2025-01-14T18:07:14Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![e.cutino](https://avatars.discourse-cdn.com/v4/letter/e/e5b9ba/32.png) [@e.cutino](https://forum.inductiveautomation.com/u/e.cutino)\
**Post date:** [January 14, 2025, 6:07pm UTC](https://forum.inductiveautomation.com/t/change-user-password-via-script/100874/1 "2025-01-14T18:07:14Z")

</div>

Using classic authentication and internal user source, is there a way for a user to change its own password without being logged in? Obviously, via old password input.

If yes (and how), is there a way via script to know how many days are still missing to the password expiration, if set in the gateway as pwd policy?

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [January 14, 2025, 6:23pm UTC](https://forum.inductiveautomation.com/t/change-user-password-via-script/100874/2 "2025-01-14T18:23:57Z")

</div>

Gateway scope will have permission to do such things. You could implement some gateway message handlers to perform the pre-checks and make the changes.

---

<div class="post-metadata">

**Author:** ![e.cutino](https://avatars.discourse-cdn.com/v4/letter/e/e5b9ba/32.png) [@e.cutino](https://forum.inductiveautomation.com/u/e.cutino)\
**Post date:** [January 14, 2025, 8:13pm UTC](https://forum.inductiveautomation.com/t/change-user-password-via-script/100874/3 "2025-01-14T20:13:40Z")

</div>

Thx Phil. Which function(s) gateway-scope to change the password and get the residual password expiration?

---

<div class="post-metadata">

**Author:** ![e.cutino](https://avatars.discourse-cdn.com/v4/letter/e/e5b9ba/32.png) [@e.cutino](https://forum.inductiveautomation.com/u/e.cutino)\
**Post date:** [January 14, 2025, 8:16pm UTC](https://forum.inductiveautomation.com/t/change-user-password-via-script/100874/4 "2025-01-14T20:16:12Z")

</div>

ps: vision project

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [January 14, 2025, 8:56pm UTC](https://forum.inductiveautomation.com/t/change-user-password-via-script/100874/5 "2025-01-14T20:56:22Z")

</div>

Whatever is available will be through `system.user.getUser()`. There are defined accessors for various properties, but others are possible. I recommend iterating over the user object and examining all of the [PropertyValue](https://files.inductiveautomation.com/sdk/javadoc/ignition81/8.1.38/com/inductiveautomation/ignition/common/config/PropertyValue.html) objects you get.

---

<div class="post-metadata">

**Author:** ![e.cutino](https://avatars.discourse-cdn.com/v4/letter/e/e5b9ba/32.png) [@e.cutino](https://forum.inductiveautomation.com/u/e.cutino)\
**Post date:** [January 14, 2025, 10:44pm UTC](https://forum.inductiveautomation.com/t/change-user-password-via-script/100874/6 "2025-01-14T22:44:44Z")

</div>

I know some accessors to user, as per manual, indeed password is stated not being in. Expiration days not mentioned at all, Clear to be changed in gateway scope, unclear to me how/which function/property. Sorry

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [January 14, 2025, 11:11pm UTC](https://forum.inductiveautomation.com/t/change-user-password-via-script/100874/7 "2025-01-14T23:11:59Z")

</div>

Not documented. That's why I recommend iterating over the actual user object of a user that has an expiring password.

---

<div class="post-metadata">

**Author:** ![e.cutino](https://avatars.discourse-cdn.com/v4/letter/e/e5b9ba/32.png) [@e.cutino](https://forum.inductiveautomation.com/u/e.cutino)\
**Post date:** [January 15, 2025, 9:17am UTC](https://forum.inductiveautomation.com/t/change-user-password-via-script/100874/8 "2025-01-15T09:17:35Z")

</div>

Successfully done and interesting! I see some points now.... 🙂

---

<div class="post-metadata">

**Author:** ![e.cutino](https://avatars.discourse-cdn.com/v4/letter/e/e5b9ba/32.png) [@e.cutino](https://forum.inductiveautomation.com/u/e.cutino)\
**Post date:** [January 15, 2025, 11:06am UTC](https://forum.inductiveautomation.com/t/change-user-password-via-script/100874/9 "2025-01-15T11:06:46Z")

</div>

Just one more question (last one, promised 😀 😀 ):  
which is the property for checking # of days remaining to pwd expiration?  
I did all the rest, found the properties but this one is not with me...

Thx!

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [January 15, 2025, 1:06pm UTC](https://forum.inductiveautomation.com/t/change-user-password-via-script/100874/10 "2025-01-15T13:06:26Z")

</div>

Sorry, don't know. I never had to investigate it.
