Deploy a Windows service with the option

I am trying to deploy a windows service to a remote machine with the option used when starting the service.

I have two problems:

  • How to use Invoke-WmiMethod (powershell) to pass a service with parameters
  • Starting the service in Windows Server 2012 with the option.

ad1) I am currently publishing a service:

Invoke-WmiMethod -class Win32_process -name Create -ArgumentList ("C:\PathToService\ServiceExecutable.exe install") -ComputerName RemoteComputer.local

This is done this way, as it is a self-configuring / uninstalling service. What I have tried so far is to get a service object after installing a service like this

$(Get-Service -ComputerName RemoteComputer.local -Name ServiceName)

but could not see how I can connect / change the launch options on it.

ad2) It completely puzzles me; services dialog

This is a regular service dialog, as I recall. Everything that you enter in the startup parameters should be passed to the service as args.

Windows Server 2012!.

Windows 8 - .

- .

Windows Server 2012 - , .

, (, admin,...).

+3
1

app.config.

, , .

0

All Articles