Reputation: 7011
I'm trying to start a service as "Network Service" user on Windows, using procrun with the ServiceUser argument:
prunsrv //IS//%SERVICE_NAME% --DisplayName=%DISPLAY_NAME% --Classpath=%CD%\%JAR_NAME%.jar;%CD% --Jvm=auto --Startup=auto --JvmOptions=-Dbv.config=%CD%\application.properties ++JvmOptions=-Daws.credentials.path=%CD%\aws-credentials.properties --StartMode=jvm --StartMethod=start --StopMethod=stop --StartClass=com.bancvue.fitransporter.Application --StartParams=start --StopMode=jvm --StopClass=com.bancvue.fitransporter.Application --StopParams=stop --LogLevel=Debug --ServiceUser="NT AUTHORITY\NetworkService"
I've tried several variations of ServiceUser, such as:
"Network Service" (this is the user I am able to manually configure on Windows) ".\NetworkService" etc.
The service starts successfully but I can't get the user to be anything other than "Local System," unless I manually start it and select Network Service as the user.
Upvotes: 2
Views: 669
Reputation: 1903
The following works;
--ServiceUser "NT AUTHORITY\NetworkService"
There's no need to specify a password.
Upvotes: 2