Archive: Check User authentication for a Service


Check User authentication for a Service
I'm currently using the Authenticate User script to validate the user/password of an account used. That part works great. Afterwords, the credentials are used to create and run a Windows service.

The issue I'm running into is that often the account the user chose, does not have "Log on as a service" rights. They find this out after the installer attempts to start the service and fails out with, "This service account does not have the necessary user right "Log on as a service.""

1) Is there a way to check this after the user account has been authenticated via some sort of registry/script/etc?
2) If #1 fails, I guess the only other solution would be a windows API call. Anyone know the black art on how this would be done with the system plugin?


ah-ha, found sample C code... now how to convert it to NSIS system plugin. How To Manage User Privileges Programmatically in Windows NT


Have a look at the UserMgr plugin...


Thanks. Did shortly after posting and it works just as I need. :)

It's all about finding the right keywords to search for... in this case: SeServiceLogonRight.