DPE Nano Services

Running as Windows service

The following actions require a command line window with local Administrator permissions.

Create windows service

  • Ensure that all Prerequisites are installed

  • Open a command line window and navigate to the folder where you copied DpeNanoServices to

  • Optionally adapt your configuration in the appsettings.json file

  • Register DpeNanoServices as windows service, e.g.

    PowerShell
    sc.exe create DpeNanoServices binPath= "\"C:\my-full-path-to-folder\DpeNanoServices.exe\" --environment Production --urls http://localhost:5000"
    
  • Alternatively you can do

    PowerShell
    sc.exe create DpeNanoServices binPath= "dotnet \"C:\my-full-path-to-folder\DpeNanoServices.dll\" --environment Production --urls http://localhost:5000"
    

Use standard windows service configuration dialog to configure a dedicated user account used to run DpeNanoServices

Delete windows service

PowerShell
sc.exe delete DpeNanoServices

Change windows service configuration

Change start type to “Automatic (Delayed)”

PowerShell
sc.exe config DpeNanoServices start= delayed-auto

Run the service under a dedicated user account

PowerShell
sc.exe config DpeNanoServices type= own obj= "domain\user" password= "password"

The account must have the “log in as service right”. The standard windows service configuration dialog handles a missing right automatically.

Alternatively you can grant the right from command-line

PowerShell
ntrights.exe +r SeServiceLogonRight -u "%DOMAIN%\%USER%"

Query windows service configuration

PowerShell
sc.exe query DpeNanoServices
sc.exe qc DpeNanoServices