coreybutler / node-windows

Windows support for Node.JS scripts (daemons, eventlog, UAC, etc).
Other
2.81k stars 356 forks source link

svc.logOnAs local user cannot start the service due to logon error #274

Closed BrianSidebotham closed 3 years ago

BrianSidebotham commented 3 years ago

Creating a new service with the following settings (and a local account to suit)

svc.logOnAs.account="serveruser";
svc.logOnAs.password="passw0rD";

results in a service that cannot start because of a logon failure. The domain looks good as in the service properties dialog the account is referenced as a local account .\serveruser but the password appears to be incorrect.

Any changes here result in the dialog outputting "Please type in a valid password". If the password given to the script (and which appears in the winsw XML config file) is filled in, the service can be correctly started.

Using node-windows 1.0.0-beta.5 on Windows Server 2016 and Windows Server 2019.

BrianSidebotham commented 3 years ago

I should also say that the XML configuration to drive winsw looks correct and allowservicelogon is set to true.

This may be a winsw issue instead of node-windows.

coreybutler commented 3 years ago

I'm sorry I never saw this. While I'm sure you've moved on by now, the only thing I can think of is identifying the domain for a logon. For example serveruser@mydomain.local. Sometimes Windows auth requires the domain, especially in an environment where Active Directory is used for auth.