Revoke-Permission

Revokes explicit permissions on a file, directory, registry key, or certificate's private key/key container.

Syntax

Revoke-Permission [-Path] <String> [-Identity] <String> [-WhatIf] [-Confirm] [<CommonParameters>]

Description

Revokes all of an identity's explicit permissions on a file, directory, registry key, or certificate's private key/key container. Only explicit permissions are considered; inherited permissions are ignored.

If the identity doesn't have permission, nothing happens, not even errors written out.

Related Commands

Parameters

Name Type Description Required? Pipeline Input Default Value
Path String

The path on which the permissions should be revoked. Can be a file system, registry, or certificate path.

true false
Identity String

The identity losing permissions.

true false
WhatIf SwitchParameter false false
Confirm SwitchParameter false false
CommonParameters This cmdlet supports common parameters. For more information type
Get-Help about_CommonParameters.

EXAMPLE 1

Revoke-Permission -Identity ENTERPRISE\Engineers -Path 'C:\EngineRoom'

Demonstrates how to revoke all of the 'Engineers' permissions on the C:\EngineRoom directory.

EXAMPLE 2

Revoke-Permission -Identity ENTERPRISE\Interns -Path 'hklm:\system\WarpDrive'

Demonstrates how to revoke permission on a registry key.

EXAMPLE 3

Revoke-Permission -Identity ENTERPRISE\Officers -Path 'cert:\LocalMachine\My\1234567890ABCDEF1234567890ABCDEF12345678'

Demonstrates how to revoke the Officers' permission to the cert:\LocalMachine\My\1234567890ABCDEF1234567890ABCDEF12345678 certificate's private key/key container.