Windows – Error 1385 when executing RUNAS on Windows Enterprise 7

permissionsrunaswindows

I am having trouble installing an application on a Windows 7 Enterprise computer. The installer creates a user under which a service process will run. However I get the code error 1385 all over my logs (installer and installed service). I managed to isolate the problem in such environment. I can reproduce it easily doing:

runas /env /user:thehostname\thejustcreatedusername

then the thejustcreatedusername password is asked, and as result I get:

Erreur de RUNAS : Impossible d'exécuter - notepad
1385 - Échec d'ouverture de session : l'utilisateur ne bénéficie pas du type d'ouverture de session demandé sur cet ordinateur.

I think it corresponds to the English version: Logon failure: the user has not been granted the requested logon type at this computer.

In the internet I found that I should grant the user the access this computer from network right. I did it following the steps at https://technet.microsoft.com/en-us/library/dd277404.aspx, through the Local Security Policy tool, but no success (still same 1385 error). I also added my user to the Users group that has that right already granted but no success. However if I add that user to the Administrators group, the RUNAS command works and I see a notepad being launched.

What setting should I change in such user to run that impersonation command successfully?

Best Answer

You probably need logon as a service right.