Skip to content

Test‑WindowsPrivilege

raandree edited this page Sep 6, 2026 · 1 revision

SYNOPSIS

Tests whether a process token privilege is enabled.

SYNTAX

Test-WindowsPrivilege [-Name] <String[]> [<CommonParameters>]

DESCRIPTION

Checks the current PowerShell process token and returns true when the named Windows privilege is present and enabled.

EXAMPLES

EXAMPLE 1

Test-WindowsPrivilege -Name SeSecurityPrivilege

Tests whether the current process can read and modify SACL information.

PARAMETERS

-Name

The Windows privilege constant name, such as SeSecurityPrivilege or SeTakeOwnershipPrivilege. Tab completion offers the well-known Windows privilege constants.

Type: String[]
Parameter Sets: (All)
Aliases:

Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False

CommonParameters

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

INPUTS

System.String

OUTPUTS

System.Boolean

NOTES

RELATED LINKS

Home

Commands

DSC resources

Clone this wiki locally