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.
The UserRights PowerShell module covers the following use cases:
PS C:\> Get-UserRight -Privileges SeBackupPrivilege