Skip to content

Set‑ProcessSecurityDescriptor

raandree edited this page Sep 6, 2026 · 1 revision

SYNOPSIS

Sets selected security descriptor sections on pinned live processes.

SYNTAX

Process (Default)

Set-ProcessSecurityDescriptor [-InputObject] <Object[]> -Sddl <String>
 [-Sections <WindowsSecurityDescriptorSection>] [-ThrottleLimit <Int32>] [-PassThru]
 [-WhatIf] [-Confirm] [<CommonParameters>]

Handle

Set-ProcessSecurityDescriptor -Handle <IntPtr[]> -Sddl <String> [-Sections <WindowsSecurityDescriptorSection>]
 [-ThrottleLimit <Int32>] [-PassThru] [-WhatIf] [-Confirm]
 [<CommonParameters>]

DESCRIPTION

Parses SDDL as data, opens PID targets once with a verified creation identity, and persists only selected sections to that process instance.

EXAMPLES

EXAMPLE 1

Set-ProcessSecurityDescriptor -ProcessId $PID -Sddl 'D:(A;;GR;;;WD)' -Sections Access -WhatIf

Previews replacing only the current process DACL.

PARAMETERS

-Handle

One or more caller-owned process handles that the module never closes.

Type: IntPtr[]
Parameter Sets: Handle
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-InputObject

One or more PIDs, Process objects, or process objects emitted by this module.

Type: Object[]
Parameter Sets: Process
Aliases: Process, Id, ProcessId

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

-PassThru

Returns the stored selected descriptor sections after persistence.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

-Sddl

A structurally valid SDDL document containing every selected section.

Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Sections

Selects the descriptor sections to persist from the SDDL document.

Type: WindowsSecurityDescriptorSection
Parameter Sets: (All)
Aliases:
Accepted values: Owner, Group, Access, Audit, All

Required: False
Position: Named
Default value: All
Accept pipeline input: False
Accept wildcard characters: False

-ThrottleLimit

Limits concurrently processed pinned targets. One requests deterministic sequential execution.

Type: Int32
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: [Math]::Max(1, [Math]::Min(8, [Environment]::ProcessorCount))
Accept pipeline input: False
Accept wildcard characters: False

-Confirm

Prompts you for confirmation before running the cmdlet.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-WhatIf

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

Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi

Required: False
Position: Named
Default value: None
Accept pipeline input: False
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.Int32

System.Diagnostics.Process

WindowsAccessControl.ProcessSecurityDescriptor

OUTPUTS

None

WindowsAccessControl.ProcessSecurityDescriptor

NOTES

RELATED LINKS

Home

Commands

DSC resources

Clone this wiki locally