Page 1 of 1

getDomainOSUser slow execution & crash

Posted: Thu May 20, 2021 7:23 pm
by Smiffy
OA V3.16 patch 23.
I have a panel push button script that has the following line.

int i = getDomainOSUser(username, fullname, description, groups, domain, password);

The parameter strings are defined in the script and are uninitialized.

This function call does return the username of the logged in user as expected. However, it takes 3 minutes or so to complete.

I also get the following error in the log file:

Module: mainModule_1
Panel: C:\HMI\Project_Name\panels\vision\Utilities\Maintenance.xml [System1 Maintenance]
Object: 252 named: "HMIShutdown" of type: PUSH_BUTTON
Script: Clicked
Library: C:\Siemens\Automation\WinCC_OA\3.16\scripts\libs\std.ctl
Line: 1760, The specified domain either does not exist or could not be contacted. (0x0000054b=1355), Administrator

I have looked at the standard script (std.ctl) and that line is:

dyn_mapping mGroups = getOSUserGroups(username,domain); // TFS 10267

The help on the getOSUserGroups function suggests that there is only one argument expected (username):

dyn_mapping getOSUserGroups(string userName);

However the std.ctl script calls the function passing in 2 arguments.
Is that what is causing the error?
Is it that which is causing the getDomainOSUser to take ages to complete?
Is there a better / faster way of getting the logged in user from the OS?

Re: getDomainOSUser slow execution & crash

Posted: Fri May 21, 2021 9:42 am
by kilianvp
use getOSUser()

Re: getDomainOSUser slow execution & crash

Posted: Mon Nov 08, 2021 8:19 am
by Victor.Ermakov
kilianvp wrote: Fri May 21, 2021 9:42 am use getOSUser()
WCCOAui freezes for a few seconds when executing getOSUser()

Re: getDomainOSUser slow execution & crash

Posted: Tue Nov 09, 2021 2:48 pm
by gschijndel
You could also try the function 'getDomainOSUserLocal'.