Modifies settings for the DFS Replication service.
PowerShell · Risk: High · Documentation Verified
Last verified: 2026-10-26
Microsoft DFSR reference: Modifies settings for the DFS Replication service. The syntax and selected example below are adapted from the pinned Windows Server 2025 reference. Module availability, target configuration and delegated permissions determine whether it can run in your environment. Documentation and parameter text: Microsoft, CC BY 4.0; formatting adapted by Cmdlet World. No execution testing is claimed.
Use an account with the target resource permissions documented for Set-DfsrServiceConfiguration. Modifying administrative cmdlets may require elevation or delegated administration. This catalog does not assert that ordinary users can execute the command.
Supported environments
Windows / DFSR · Windows Server 2025 documentation; feature/module prerequisites apply
Parameters
-CleanupConflictFolderAtPercent
Specifies a percent value from 80 to 100. The default value is 90. When the ConflictsAndDeleted folder size reaches this percent of the ConflictsAndDeleted quota, the DFS Replication service deletes the oldest files until the folder size falls below a set percent of the quota. You can specify that percent value by using the *CleanupConflictFolderUntilPercent* parameter.
-CleanupConflictFolderUntilPercent
Specifies a percent value from 10 to 100. The default value is 60. After the DFS Replication service starts cleanup of the ConflictsAndDeleted folder, it continues to delete the oldest files until the folder size reaches this percent of the ConflictsAndDeleted quota.
-CleanupStagingFolderAtPercent
Specifies a percent value from 80 to 100. The default value is 90. When the staging folder size reaches this percent of the staging folder quota, the DFS Replication service deletes the oldest files until the folder size falls below a set percent of the quota. You can specify that percent value by using the *CleanupStagingFolderUntilPercent* parameter.
-CleanupStagingFolderUntilPercent
Specifies a percent value from 10 to 80. The default value is 60. After the DFS Replication service starts cleanup of the staging folder, it continues to delete the oldest files until the folder size reaches this percentage of the staging folder quota.
-ComputerName
Specifies an array of names of replication member computers. The cmdlet modifies membership settings for these member computers. You can use a comma separated list and the wildcard character (*). If you do not specify this parameter, the cmdlet modifies settings for the current computer.
-Confirm
Prompts you for confirmation before running the cmdlet.
-DebugLogPath
Specifies a folder path for DFS Replication debug logs. The default location for the logs is %SystemRoot%\Debug. If you specify a custom location for logs by using this parameter, select a drive that DFS Replication does not use for replication. Selecting a drive that DFS Replication does not use for replication minimizes the impact of logging on replication performance.
-DebugLogSeverity
Specifies a severity level for debug log entries. The acceptable values for this parameter are: - 1 - Write log header information only. - 2 - Write errors and header information. - 3 - Write warning, error, and header information. - 4 - Write informational, warning, error, and header information. - 5 - Write trace, informational, warning, error, and header information. The default value on a DFS Replication computer is 4. If you increase the severity, performance can suffer. Use a higher severity level only for troubleshooting. If you decrease the severity, performance increases slightly but you might lose information necessary to troubleshoot issues and lose root cause information.
-DisableDebugLog
Indicates whether to disable debug logging. If you disable debug logging, performance increases slightly but you might lose information necessary to troubleshoot issues and lose root cause information.
-MaximumDebugLogFiles
Specifies the number of debug log files to keep. The acceptable values for this parameter are: integers from zero (0) to 100,000. By default, DFS Replication stores 1000 log files. A larger value can degrade performance.
-MaximumDebugLogMessages
Specifies the number of messages to write in each debug log file. The acceptable values for this parameter are: integers from 1000 to 4294967295. The default value is 200,000.
-RPCPort
Specifies a static TCP port for the DFS Replication service to listen on for the Remote Procedure Call (RPC) protocol. The acceptable values for this parameter are: integers from 1024 to 65535. By default, DFS Replication listens on a dynamic port. Specify a value of zero (0) or $Null for DFS Replication to listen on a dynamic port. Microsoft recommends a dynamic port. You might need to specify a static port to accommodate a firewall.
-UnexpectedAutoRecovery
Indicates whether to set the value for the registry key named StopReplicationAutoRecovery to zero (0) or one (1). A value of zero allows the server to automatically recover after it shuts down incorrectly or hardware fails. Specify a value of $False to set this registry value to one (1). The default value is zero. When a server shuts down incorrectly and recovers automatically, the database must be validated. Setting the value to one allows you to perform other recovery, backup, or troubleshooting options before resuming replication. The recommended value for this parameter is $True.
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Prerequisites
Windows with the DFSR module and the Windows feature or management tools that provide it. Confirm target connectivity and version compatibility using the linked Microsoft reference.
Security considerations
This cmdlet changes system state. Review every target and parameter in the official reference, test outside production, and prepare an appropriate backup or rollback. Do not execute the example automatically.
Examples
Example 1: Configure a computer to use a dynamic RPC port
Set-DfsrServiceConfiguration -RPCPort 0
This command configures the local computer to use a dynamic RPC port for DFS Replication. A value of zero (0) or $Null for the *RPCPort* parameter configures the computer to use a dynamic port. Source: Microsoft, CC BY 4.0; transcript prompt/output removed. This example was not executed.