×
Siemens Industry Online Support
Siemens AG
Entry type: Application example Entry ID: 9276354, Entry date: 09/15/2004
(2)
Rate

changing the user password in Runtime (SIMATIC WinCC V5/V6)

  • Entry
  • Associated product(s)


QUESTION:
How can I change the password of the logged-in user in SIMATIC WinCC Runtime?

ANSWER:
For this you can use the WinCC API function "PWGENChangePassword", which requires four parameters:

  1. User name
  2. Old password of the user
  3. New password of the user
  4. Pointer to an error structure

The return value of the function "TRUE" if the password change has been successful and "FALSE" if an error has occurred.

Before calling this function you have to set up a connection to the database. You can use the "PWGENConnect" function. This function requires the parameters "DataSourceName" of the project and a pointer to an error structure. If the connection to the database is set up successfully, the return value of the function is "TRUE", if not, "FALSE".

Once you have successfully changed the password you should clear down the connection to the database using the "PWGENDisconnect" function. This function requires a pointer to an error structure as parameter and after successful disconnection the return value is "TRUE", otherwise "FALSE".

Note:
When using this functionality, note the configuration of your system. In server-client/multiclient mode the password has to be changed on each station.

The download includes a WinCC project that uses the above-mentioned functions in a dialog box. Also implemented is a check of the user name, old password and new password.



This project has been created using "WinCC V5.0 SP2" and be used in WinCC up to V5.1.

pw_change.exe

 

This project has been created using "WinCC V5.0 SP2" and migrated for WinCC V6.0 SP2.

pw_change_v6.exe

 

Copy the "pw_change.exe" or "pw_change_v6.exe" file into a separate directory and then start the file with a double-click. The WinCC project now unpacks with all the associated subdirectories. You can then use the WinCC Explorer to open and process the unpacked project. You have to change the computer name accordingly to activate the project.

Keywords:
Password change

Security information
In order to protect technical infrastructures, systems, machines and networks against cyber threats, it is necessary to implement – and continuously maintain – a holistic, state-of-the-art IT security concept. Siemens’ products and solutions constitute one element of such a concept. For more information about cyber security, please visit
https://www.siemens.com/cybersecurity#Ouraspiration.