Curated Examples
Review a user-rights assignment
Use SecurityPolicy to inspect a selected user-rights assignment.
This pattern is useful before changing a privilege assignment on a workstation or server.
It comes from the source example at Examples/GetUserRights.ps1.
When to use this pattern
- You need to confirm the current identities on a privilege.
- You want table output that can be pasted into a change record.
- You are preparing a controlled add or remove operation.
Example
Import-Module SecurityPolicy
$assignment = Get-UserRightsAssignment -UserRightsAssignment SeBackupPrivilege
$assignment | Format-Table
What this demonstrates
- querying a single user-rights assignment
- keeping review and change steps separate
- using a named Windows privilege in the script