Get-DfsrPreservedFiles

Get-DfsrPreservedFiles

Gets a list of files and folders that DFS Replication previously preserved.

Syntax

Parameter Set: Default
Get-DfsrPreservedFiles [-Path] <String> [ <CommonParameters>]

Detailed Description

The Get-DfsrPreservedFiles cmdlet gets a list of preserved files and folders. The Distributed File System (DFS) Replication service preserves the following kinds of files and folders:

-- Conflicted. If users make changes to the same file on multiple servers before replication converges, a file might conflict with the current version. DFS Replication preserves previous conflicting versions of the file.
-- Deleted. When a member computer deletes a replicated file, other members also remove that file. Depending on membership settings, computers can preserve deleted files. To modify whether a member computer preserves deleted files, use the Set-DfsrMembership cmdlet.
-- Preexisting. If DFS Replication overwrites files during its initial synchronization, DFS Replication preserves those files.

For all three types, DFS Replication moves the files and folders to <replicated folder>\DfsrPrivate\ConflictsAndDeleted or <replicated folder>\DfsrPrivate\Preexisting. DFS Replication records these files in a manifest, either ConflictAndDeletedManifest.xml or PreexistingManifest.xml, as appropriate. Specify the ConflictAndDeletedManifest.xml manifest to view conflicted and deleted files and folders. Specify the PreexistingManifest.xml manifest to view preexisting files and folders. You can use the Restore-DfsrPreservedFiles cmdlet to restore files and folders.

Parameters

-Path<String>

Specifies the path of a manifest. By default, the manifest files exist in the <Replicated Folder>\DfsrPrivate folder. Specify ConflictAndDeletedManifest.xml to view conflicted and deleted files. Specify PreexistingManifest.xml to view preexisting files.

Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

True (ByValue, ByPropertyName)

Accept Wildcard Characters?

true

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see    about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

  • string

Outputs

The output type is the type of the objects that the cmdlet emits.

  • Microsoft.DistributedFileSystemReplication.DfsrPreservedEntry

Examples

Example 1: Get conflicted and deleted files and folders for a replicated folder

This command gets a list of conflicted and deleted files and folders for the replicated folder C:\RF1. The command specifies the manifest for that replicated folder. The console displays the file name and other data.

PS C:\> Get-DfsrPreservedFiles -Path "C:\RF01\DfsrPrivate\ConflictAndDeletedManifest.xml"

Example 2: Get preexisting files for a replicated folder

This command gets a list of preexisting files and folders for the replicated folder C:\RF01. The console displays the file name and other data.

PS C:\> Get-DfsrPreservedFiles -Path "C:\RF01\DfsrPrivate\PreExistingManifest.xml"

Example 3: Look for conflicting or deleted files by using a name

This command looks for conflicting or deleted files that have a name that contains the string canary. The command gets the preserved files recorded in the specified manifest. The command then passes those files to the Where-Object cmdlet by using the pipeline operator. That cmdlet passes files that match the criteria back to the console. For more information, type Get-Help Where-Object.

In this example, the command finds a file, named canary.bmp. You could use the Restore-DfsrPreservedFiles to restore this file.

PS C:\> Get-DfsrPreservedFiles -Path "C:\RF01\DfsrPrivate\ConflictAndDeletedManifest.xml" | Where-Object Path -like "*canary*"

Restore-DfsrPreservedFiles