Project

SecurityPolicy

Provides a way to configure user rights assignments in local security policies using PowerShell without using secedit.exe.

Stars22
Forks4
Open issues2
PowerShell Gallery downloads115454722
Releasev0.0.13
Language: PowerShell Updated: 2026-02-14T21:45:31.0000000+00:00

Curated Examples

Stage a user-rights change

Use SecurityPolicy with WhatIf before changing a privilege assignment.

This pattern is useful when a security policy change needs a dry run before it is applied.

It comes from the source example at Examples/SetUserRights.ps1.

When to use this pattern

  • You are preparing a controlled user-rights assignment update.
  • You want to validate the intended identity list first.
  • The change should be reviewable before execution.

Example

Import-Module SecurityPolicy

$identity = @(
    'BUILTIN\Backup Operators'
    'BUILTIN\Administrators'
)

Set-UserRightsAssignment -UserRightsAssignment SeBackupPrivilege -Identity $identity -WhatIf

What this demonstrates

  • using an explicit identity list
  • staging the update with -WhatIf
  • targeting a single named privilege

Source