---
title: Running the server as a Microsoft Windows service
description: The server can run as a Windows service on Windows Server 2016, 2019, and 2022. This enables logging out of a machine without the server being stopped.
component: pingdirectory
version: 11.0
page_id: pingdirectory:pingdatasync_server_administration_guide:pd_sync_run_server_ms_windows_service
canonical_url: https://docs.pingidentity.com/pingdirectory/11.0/pingdatasync_server_administration_guide/pd_sync_run_server_ms_windows_service.html
revdate: September 13, 2023
page_aliases: ["pd_sync_register_service.adoc", "pd_sync_run_multiple_service_instances.adoc", "pd_sync_deregister_uninstall.adoc", "pd_sync_log_files.adoc"]
section_ids:
  register-the-service: Register the service
  steps: Steps
  run-multiple-service-instances: Run multiple service instances
  deregister-and-uninstall: Deregister and uninstall
  log-files: Log files
---

# Running the server as a Microsoft Windows service

The server can run as a Windows service on Windows Server 2016, 2019, and 2022. This enables logging out of a machine without the server being stopped.

## Register the service

### Steps

1. Stop the server using the `bin\stop-server` command. A server cannot be registered while it is running.

2. Register the server as a service. From a Windows command prompt, run `bat\register-windows-service.bat`.

3. After a server is registered, start the server from the Windows Services Control Panel or with the `bat\start-server.bat` command.

   |   |                                                                                                                                                                                                                      |
   | - | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
   |   | Command-line arguments for the `start-server.bat` and `stop-server.bat` scripts are not supported while the server is registered to run as a Windows service. Using a task to stop the server is also not supported. |

## Run multiple service instances

Only one instance of a particular service can run at one time. Services are distinguished by the `wrapper.name` property in the `<server-root>\config\wrapper-product.conf` file. To run additional service instances, change the `wrapper.name` property on each additional instance. Descriptions of the services can also be added or changed in the `wrapper-product.conf` file.

## Deregister and uninstall

While a server is registered as a service, it cannot run as a non-service process or be uninstalled. Use the `bat\deregister-windows-service.bat` file to remove the service from the Windows registry. The server can then be uninstalled with the `uninstall.bat` script.

## Log files

The log files are stored in `<server-root>\logs`, and file names begin with `windows-service-wrapper`. They are configured to rotate each time the wrapper starts or because of file size. Only the last three log files are retained. These configurations can be changed in the `<server-root>\config\wrapper.conf` file.
