Bearbeiten

Freigeben über


Restore-ACL

Restores the security descriptor of a specified item.

Syntax

Restore-ACL
       [-Path] <String>
       -XmlPath <String>
       -LogPath <String>
       [-WhatIf]
       [-Confirm]
       [<CommonParameters>]

Description

The Restore-ACL cmdlet restores the security descriptor of a specified item, such as a file or a registry key.

Examples

Example 1: Restore the ACL for a file

Restore-ACL -Path  "C:\file01.txt" -XmlPath "C:\AclBackups\Backup-C-AclBackups-file01.txt-2021-11-02-02-14-11.xml" -LogPath "C:\AclBackupLogs\"

This command restores the ACL specified by the XmlPath parameter for the specified file.

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-LogPath

Specifies the full path of the log file.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Path

Specifies the full path of the object for which the cmdlet restores permissions.

Type:String
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-XmlPath

Specifies the full path of the the XML file that contains ACL back up.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

Inputs

String

Outputs

Object