26

What is an equivalent for ntrights.exe on Windows 7?

I need it to be able to be run from the command line.

oleschri
  • 1,185
Avery3R
  • 764
  • 4
  • 12
  • 25

5 Answers5

20

You can still use ntrights from the Windows Server 2003 Resource Kit Tools. Although not supported naturally, many of the tools performs flawlessly (including ntrights.exe).

Proof: Microsoft TechNet (scroll down until you find the Tool table, including NTRights.exe as one of the tools that can be used).

A Dwarf
  • 19,091
12

If you want to do it in Powershell you can install Powershell Community Extensions (PSCX) and use their Get-Privilege and Set-Privilege cmdlets.

Example from PSCX Help:

$p = Get-Privilege
$p.Enable('SeTimeZonePrivilege')
Set-Privilege $p
Get-Privilege | ft Name, Status -a

Name Status
---- ------
SeShutdownPrivilege Disabled
SeChangeNotifyPrivilege EnabledByDefault, Enabled
SeUndockPrivilege Disabled
SeIncreaseWorkingSetPrivilege Disabled
SeTimeZonePrivilege Enabled

By default it acts on the current user, but you can pass it a specific windows identity, of course.

200_success
  • 1,231
oleschri
  • 1,185
  • How can I get the identity to pass it, if I want to set a privilege for a different user? – Peter Mounce Aug 07 '13 at 12:03
  • @PeterMounce Both cmdlets have an -Identity parameter, so you should be a able to specify another user. But I haven't tried that myself. – oleschri Aug 08 '13 at 09:44
  • I did try that, and it didn't accept a string containing the username as a valid identity; I assume therefore it wants an object. – Peter Mounce Aug 08 '13 at 15:51
  • @PeterMounce It seems to expect a System.Security.Principal.WindowsIdentity. Couldn't get it to run with another user either. – oleschri Aug 09 '13 at 08:59
  • yes; how do I get hold of one of those? – Peter Mounce Aug 09 '13 at 10:03
  • @PeterMounce I could only get a WindowsIdentity for my currently loggend on user. You could post this as a new Powershell question on SuperUser or ServerFault. – oleschri Aug 12 '13 at 13:58
  • Note that the Get-Privilege cmdlet does NOT support all kinds of privileges. For example unsupported are SeBatchLogonRight and SeServiceLogonRight. See this issue with a reference to all supported rights. – FireEmerald May 04 '21 at 15:08
3

Although its not suitable for scripting, The user management plugin for the orthodox file manager Far Manager will let you do this from the console. If you are running the 64 bit version of farmanager, you will need the 64 bit version of the plugin from the evil programmers google code project.

LawrenceC
  • 73,957
0

Almost ten years laterXD To show privileges "WhoAmI.exe /Priv" might do it, but "SecEdit.exe" could be worth a look at as well.

Hint: If the command "FSUtil" exits with errorlevel 1, you do NOT have admin privileges.

Thomas
  • 1
0

ntrights may be getting more difficult to find, and certainly isn't supported. For those interested, I wrote an open-source alternative:

https://github.com/Bill-Stewart/PrivMan

You can download the executables from the Releases page.

Bill_Stewart
  • 1,392