Edit

Share via


Restore-ACL

Restores the security descriptor of a specified item.

Syntax

Default (Default)

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.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:cf

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-LogPath

Specifies the full path of the log file.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-Path

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

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:0
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-WhatIf

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

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:wi

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-XmlPath

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

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

String

Outputs

Object