Summary

A question raised quite often in many discussion lists, as well as by a number of attendees in my PowerShell classes is: How can we manage user rights with PowerShell. There are some code snippets available – mainly demos on how to invoke the Win32 functions of the advapi.dll – but they don’t work out of the box, and they do not cover the whole story. Additionally there is the good old ntrights.exe. This will help granting or revoking a user right, but it does not offer a way to get a list of all rights and the associated accounts. The UserRights PowerShell module covers all this.

Use Cases

The UserRights PowerShell module covers the following use cases:

  • Get a list of users assigned a specific user right
  • Get a list of user rights assigned to a specific user
  • Get a list of all user rights with accounts
  • Grant a user a or group a user right
  • Revoke a user a or group a user right

 

PS C:\> Get-UserRight -Privileges SeBackupPrivilege

BUILD INFO

Last edited Aug 27, 2014 at 9:52 PM by raandree, version 1