invalid windows credentials

This forum is designated to discuss SiComponents Scheduling Agent.
rbaroniunas
Posts: 19
Joined: Wed Dec 25, 2019 2:13 am

invalid windows credentials

Post by rbaroniunas »

I am using the scheduler wizard to insert a task, when i get up to step 5 and it automatically locates the user account, it has my domain and username but it fails when i enter the password with invalid credentials.

Why is this happening

How can i check what is being selected by the wizard ?

isiticov
Site Admin
Posts: 2265
Joined: Thu Nov 21, 2002 3:17 pm

Re: invalid windows credentials

Post by isiticov »

Hello,
Can you try to use double-slash in user name after the domain name?
For example:
DOMAIN\\UserName instead of DOMAIN\\UserName.
Please let me know if this helped.

rbaroniunas
Posts: 19
Joined: Wed Dec 25, 2019 2:13 am

Re: invalid windows credentials

Post by rbaroniunas »

No, that doesn't work. Apparently is it looking only at the Windows 10 Pro Administrator account and no other account is allowed to be used.

Tried

\\Doman\username
\\Domain\\username
Domain\\username
Domain\username
\\username

None work

rbaroniunas
Posts: 19
Joined: Wed Dec 25, 2019 2:13 am

Re: invalid windows credentials

Post by rbaroniunas »

How does the wizard know which account to look up by default and if i use any other accounts that work it rejects and it, giving the impression it is only using one account the local admin.

isiticov
Site Admin
Posts: 2265
Joined: Thu Nov 21, 2002 3:17 pm

Re: invalid windows credentials

Post by isiticov »

Hello,

The wizard just uses GetUserName() Windows API to get the current user name for this field in wizard's UI. But you can enter anything you want into this field. So you can always enter manually the proper user name. And this will be used to set the task's credentials.
Best regards,
Igor Sitikov.

rbaroniunas
Posts: 19
Joined: Wed Dec 25, 2019 2:13 am

Re: invalid windows credentials

Post by rbaroniunas »

Every time i enter any windows user name and password it tells me invalid credentials not allowing me to go further.

isiticov
Site Admin
Posts: 2265
Joined: Thu Nov 21, 2002 3:17 pm

Re: invalid windows credentials

Post by isiticov »

You're using a demo project from VCL Scheduling Agent delivery, am I right?
Are you able to create "Quick Demo Tasks" from "Quick Demos" menu on toolbar?
Is you active account has administrative privileges? May be you can't set task's user credentials due to limited rights on the current account?
Best regards,
Igor Sitikov.

rbaroniunas
Posts: 19
Joined: Wed Dec 25, 2019 2:13 am

Re: invalid windows credentials

Post by rbaroniunas »

No, i am using it in my production application and using the latest version.

It fails in saTask unit

pRegisteredTask := itf.RegisterTaskDefinition(Name, FTaskDefinition,
TASK_CREATE_OR_UPDATE, AAccountName, APassword,
TASK_LOGON_PASSWORD, '');

This raises error EOSERROR, What does that mean ?

FTaskManager.CurrentFolderPath = '\'

rbaroniunas
Posts: 19
Joined: Wed Dec 25, 2019 2:13 am

Re: invalid windows credentials

Post by rbaroniunas »

I uninstalled and resintalled getting the EOSError in SATASK Unit. No message as to why.

rbaroniunas
Posts: 19
Joined: Wed Dec 25, 2019 2:13 am

Re: invalid windows credentials

Post by rbaroniunas »

Apparently it seems that there is an issue if you use the local default admin, it does not work and returns a EOSERROR

I tried trapping it but it was blank.

There must be a Windows 10 thing about it.

isiticov
Site Admin
Posts: 2265
Joined: Thu Nov 21, 2002 3:17 pm

Re: invalid windows credentials

Post by isiticov »

Can you try to temporary modify the mentioned code in saTask.pas unit as the following:

Code: Select all

      try
        pRegisteredTask := itf.RegisterTaskDefinition(Name, FTaskDefinition,
          TASK_CREATE_OR_UPDATE, AAccountName, APassword,
          TASK_LOGON_PASSWORD, '');
      except
        on E: EOSError do
        begin
          ShowMessage(Format('%s'#13#10'Error code: %d', [E.Message, E.ErrorCode]));
          raise;
        end;
      end;
and add Dialogs to uses and let me know the message displayed. This will help to detect what kind of problem is there.
Or you can modify wizard's code and enclose FTask.SetAccountInformation(wsAccount, wsPassword); into similar try/except block to detect the error message and error code.
Best regards,
Igor Sitikov.

rbaroniunas
Posts: 19
Joined: Wed Dec 25, 2019 2:13 am

Re: invalid windows credentials

Post by rbaroniunas »

It gave me a error code 5 which is access denied. This just recently started since using the new update. What UAC permission do i need to adjust towards ? I do not want the application that i developed to be executed as administrator otherwise clients will complain about that.

rbaroniunas
Posts: 19
Joined: Wed Dec 25, 2019 2:13 am

Re: invalid windows credentials

Post by rbaroniunas »

One more piece, i ran it with Administrator rights and set to create the task with the highest privilege, it allows to be used without the error code. What would i need to adjust in the UAC to bypass this ?

isiticov
Site Admin
Posts: 2265
Joined: Thu Nov 21, 2002 3:17 pm

Re: invalid windows credentials

Post by isiticov »

What kind of trigger do you try to use for this task?
Just some notes from MSDN:
Only a member of the Administrators group can create a task with a boot trigger.
Also:
You cannot register a task that has more privileges than the account requesting the registration.
https://docs.microsoft.com/en-us/window ... ning-tasks
In short: you can't create a task with "administrator" settings when running under non-admin user.
This doesn't mean that you must use "Run as Admin" to run your application to add admin tasks, just current OS user shall have admin rights.
So if you run your application under "limited" user then you are unable to add tasks that contain any admin related settings.
Best regards,
Igor Sitikov.

isiticov
Site Admin
Posts: 2265
Joined: Thu Nov 21, 2002 3:17 pm

Re: invalid windows credentials

Post by isiticov »

rbaroniunas wrote:
Thu Jul 16, 2020 2:12 pm
set to create the task with the highest privilege, it allows to be used without the error code. What would i need to adjust in the UAC to bypass this ?
Highest privilege setting requires admin rights for the user.
Best regards,
Igor Sitikov.

Post Reply