Restores files and folders that DFS Replication previously preserved.
PowerShell · Risk: High · Documentation Verified
Last verified: 2026-10-26
Microsoft DFSR reference: Restores files and folders that DFS Replication previously preserved. 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 Restore-DfsrPreservedFiles. 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
-AllowClobber
Indicates that the cmdlet overwrites files of the same name that currently exist in the destination. If you do not specify this parameter, the cmdlet prompts you before overwriting existing files.
-Confirm
Prompts you for confirmation before running the cmdlet.
-CopyFiles
Indicates that the cmdlet copies files instead of moving them. If you do not specify this parameter, the cmdlet moves the preserved files but restores only the latest version of a file. You will lose previous versions of conflicted or deleted files. Preexisting files never have multiple versions. To avoid losing previous versions, consider backing up the ConflictsAndDeleted folder. As an alternative, specify the *RestoreAllVersions* parameter.
-Force
Forces the command to run without asking for user confirmation.
-Path (required)
Specifies the path of a manifest. By default, the manifest files exist in the \\DfsrPrivate folder. Specify ConflictAndDeletedManifest.xml to restore conflicted and deleted files. Specify PreExistingManifest.xml to restore preexisting files.
-RestoreAllVersions
Indicates that the cmdlet restores all versions of a file. The cmdlet adds a time stamp to the file name. This parameter affects only conflicted files or deleted files. Preexisting files never have multiple versions. If you do not specify this parameter, the cmdlet restores only the most recent version of the file. If you do not specify this parameter and do not specify the *CopyFiles* parameter, the cmdlet restores the most recent version and removes all versions from the ConflictsAndDeleted folder. Consider backing up the ConflictsAndDeleted folder before you use this cmdlet.
-RestoreToOrigin (required)
Indicates that the cmdlet restores all files and folders recorded in the ConflictAndDeletedManifest.xml manifest or the PreExistingManifest.xml manifest to their original locations. To restore to a different location, specify a path by using the *RestoreToPath* parameter.
-RestoreToPath (required)
Specifies a location for files and folders recorded in the ConflictAndDeletedManifest.xml manifest or the PreExistingManifest.xml manifest. To restore to the original locations, specify the *RestoreToOrigin* parameter.
-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: Restore preexisting files to their original locations
This command restores preexisting files and folders in the replicated folder C:\RF01 to their original locations. The command does not specify the *CopyFiles* parameter. Therefore, it moves the files and leaves the Preexisting folder empty. Source: Microsoft, CC BY 4.0; transcript prompt/output removed. This example was not executed.