Restore-DfsrPreservedFiles

적용 대상: Windows 10, Windows Server Technical Preview

Restore-DfsrPreservedFiles

Restores files and folders that DFS Replication previously preserved.

구문

Parameter Set: RestorePath
Restore-DfsrPreservedFiles [-Path] <String> [-RestoreToPath] <String> [[-RestoreAllVersions]] [[-CopyFiles]] [-AllowClobber] [-Force] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: RestoreOrigin
Restore-DfsrPreservedFiles [-Path] <String> [-RestoreToOrigin] [[-RestoreAllVersions]] [[-CopyFiles]] [-AllowClobber] [-Force] [-Confirm] [-WhatIf] [ <CommonParameters>]

자세한 설명

The Restore-DfsrPreservedFiles cmdlet restores 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 to <replicated folder>\DfsrPrivate\ConflictAndDeleted 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 restore conflicted and deleted files and folders. Specify the PreExistingManifest.xml manifest to restore preexisting files and folders. You can use the Get-DfsrPreservedFiles cmdlet to view preserved files and folders.

CAUTION By default, this cmdlet moves all files and removes any existing preserved files, including older versions of files. Consider backing up the ConflictsAndDeleted and Preexisting folder before you use this cmdlet.

매개 변수

-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.

별칭

none

필수 여부

false

위치

named

기본값

none

파이프라인 입력 허용 여부

false

와일드카드 문자 허용 여부

false

-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.

별칭

none

필수 여부

false

위치

4

기본값

none

파이프라인 입력 허용 여부

false

와일드카드 문자 허용 여부

false

-Force

사용자에게 확인 메시지를 표시하지 않고 명령을 강제 실행합니다.

별칭

none

필수 여부

false

위치

named

기본값

none

파이프라인 입력 허용 여부

false

와일드카드 문자 허용 여부

false

-Path<String>

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

별칭

none

필수 여부

true

위치

1

기본값

none

파이프라인 입력 허용 여부

True (ByValue, ByPropertyName)

와일드카드 문자 허용 여부

false

-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.

별칭

none

필수 여부

false

위치

3

기본값

none

파이프라인 입력 허용 여부

false

와일드카드 문자 허용 여부

false

-RestoreToOrigin

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.

별칭

none

필수 여부

true

위치

2

기본값

none

파이프라인 입력 허용 여부

false

와일드카드 문자 허용 여부

false

-RestoreToPath<String>

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.

별칭

none

필수 여부

true

위치

2

기본값

none

파이프라인 입력 허용 여부

false

와일드카드 문자 허용 여부

false

-Confirm

cmdlet을 실행하기 전에 확인 메시지를 표시합니다.

필수 여부

false

위치

named

기본값

false

파이프라인 입력 허용 여부

false

와일드카드 문자 허용 여부

false

-WhatIf

cmdlet이 실행되는 경우 발생할 결과를 보여 줍니다. cmdlet은 실행되지 않습니다.

필수 여부

false

위치

named

기본값

false

파이프라인 입력 허용 여부

false

와일드카드 문자 허용 여부

false

<CommonParameters>

이 cmdlet은 -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, -OutVariable 등의 일반 매개 변수를 지원합니다. 자세한 내용은 TechNet의 about_CommonParameters(https://go.microsoft.com/fwlink/p/?LinkID=113216)

입력

입력 형식은 cmdlet으로 파이프할 수 있는 개체의 형식입니다.

  • string

출력

출력 형식은 cmdlet 실행 시 출력되는 개체의 형식입니다.

  • None

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.

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

Example 2: Restore copies of preexisting files to a different location

This command restores copies of preexisting files and folders in the replicated folder C:\RF01 to the location C:\DFSRTest. The command specifies the location by using the RestoreToPath parameter. The command uses the AllowClobber parameter. Therefore, it overwrites existing files that have the same names in the specified location. The command uses the Verbose parameter to display information in the console.

PS C:\> Restore-DfsrPreservedFiles -Path "C:\RF01\DfsrPrivate\PreExistingManifest.xml" -RestoreToPath "C:\DFSRTest" -CopyFiles -AllowClobber -Verbose

Example 3: Restore conflicted and deleted files to a different location

This example restores multiple versions of conflicted and deleted files to a specified location.

The first command restores conflicted and deleted files and folders for the replicated folder C:\FR01 to the location C:\DFSRRestore. The command restores all preserved versions of the files. The command includes the Force parameter, and therefore, it does not prompt you for confirmation and overwrites any files in the destination.

The second command uses the Get-ChildItem cmdlet to display information about the restored files. For more information, type Get-Help Get-ChildItem. In this example, the first command restores multiple versions of the same file.

PS C:\> Restore-DfsrPreservedFiles -Path "C:\RF01\DfsrPrivate\ConflictAndDeletedManifest.xml" -RestoreToPath "C:\DFSRRestore" -RestoreAllVersions -Force
PS C:\> Get-ChildItem -Path "C:\DFSRRestore"

관련 항목

Get-DfsrPreservedFiles

Set-DfsrMembership