< Back

Revoke-UserRight

Wed Jan 15, 2020 2:34 am

NAME Revoke-UserRight



SYNOPSIS

Revokes rights granted to an account.





SYNTAX

Revoke-UserRight [-Name] <String[]> [-AccountName] <Object[]> [-WhatIf] [-Confirm] [<CommonParameters>]



Revoke-UserRight [-AccountName] <Object[]> -AllRights [-WhatIf] [-Confirm] [<CommonParameters>]





DESCRIPTION

Revokes the rights granted to an account or set of accounts.



The All switch may be used to revoke all rights granted to the specified accounts.





PARAMETERS

-Name <String[]>

The user right, or rights, to query.



Required? true

Position? 2

Default value

Accept pipeline input? false

Accept wildcard characters? false



-AccountName <Object[]>

Grant rights to the specified principals. The principal may be a string, an NTAccount object, or a

SecurityIdentifier object.



Required? true

Position? 3

Default value

Accept pipeline input? false

Accept wildcard characters? false



-AllRights [<SwitchParameter>]

Clear all rights granted to the specified accounts.



Required? true

Position? named

Default value False

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-UserRight -Name 'Log on as a service' -AccountName 'JonDoe'



Revokes the logon as a service right granted to the account named JonDoe.









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



PS C:\\>Revoke-UserRight -AccountName 'JonDoe' -All



Revokes all rights which have been granted to the identity JonDoe.











RELATED LINKS