< Back

Revoke-CPermission

Sun Jan 12, 2020 11:04 pm

NAME Revoke-CPermission



SYNOPSIS

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





SYNTAX

Revoke-CPermission [-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.





PARAMETERS

-Path <String>

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



Required? true

Position? 1

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Identity <String>

The identity losing permissions.



Required? true

Position? 2

Default value

Accept pipeline input? false

Accept wildcard characters? false



-WhatIf [<SwitchParameter>]



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Confirm [<SwitchParameter>]



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS



-------------------------- EXAMPLE 1 --------------------------



PS C:\\>Revoke-CPermission -Identity ENTERPRISE\\Engineers -Path 'C:\\EngineRoom'



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









-------------------------- EXAMPLE 2 --------------------------



PS C:\\>Revoke-CPermission -Identity ENTERPRISE\\Interns -Path 'hklm:\\system\\WarpDrive'



Demonstrates how to revoke permission on a registry key.









-------------------------- EXAMPLE 3 --------------------------



PS C:\\>Revoke-CPermission -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.











RELATED LINKS

Carbon_Permission

Disable-CAclInheritance

Enable-CAclInheritance

Get-CPermission

Grant-CPermission

Test-CPermission