I start WinCC Runtime Professional on PC as Service with Local User "Scada_Runer". PC in domain. The domain user logs in via RDP and starts the Graphics Runtime. There will be several users in total and I will need to save user actions, which parameters they have changed. I don't want to use Siemens users on the TIA portal. These are unnecessary actions for users. And I've already got the functionality I need.
I want to load Windows User Name via VBS. I found three ways to do this. I start VBScript by time each 2 mins.
Code: Select all
' Test WScript.Network --------------
Dim strWindowsUser
strWindowsUser = CreateObject("WScript.Network").UserName
HMIRuntime.Tags("CurWinUser").Write strWindowsUser
' -----------------------------------
' Test Shell User ----------------
Dim wshShell, strShellUser
Set wshShell = CreateObject("WScript.Shell")
strShellUser = wshShell.ExpandEnvironmentStrings("%USERNAME%")
HMIRuntime.Tags("ShellUserTag").Write strShellUser
' -----------------------------------
' Test AD System Info ---------------
Dim objSysInfo, strUserDN
Set objSysInfo = CreateObject("ADSystemInfo")
strUserDN = objSysInfo.userName
HMIRuntime.Tags("ADSysUserTag").Write strUserDN
' ------------------------------------
Now i fount only one way. Checking UserName after load and if it = "Scada_Runer" then do not save. But i do not like this way. In this case i load true user name only one time after login.
Please help. Maybe it can be solved somehow?