1

How do I grant specific privileges (not permissions) to a specific user? I'm confused because it seems there are "permissions" and "privileges" and I need to be able to grant the SE_SYSTEMTIME_NAME privilege so that a piece of software I wrote can modify the system clock in Windows 7. Apparently I need this privilege granted so I can make the the call to SetSystemTime defined by:

 Declare Function SetSystemTime Lib "Kernel32.dll" (ByRef lpSystemTime As SYSTEMTIME) As UInt32

However, I am unclear as to how to grant this privilege. I do have Administrator permissions so I should be able to enable this privilege. I've been going crazy trying to figure this out. Any help on how to st privileges within Windows 7 would be greatly appreciated.

In short I want to know how to use the Windows 7 user interface or system utility to grant the SE_SYSTEMTIME_NAME privilege to my account. How do I get this privilege granted so I can set the system time?

GregH
  • 12,278
  • 23
  • 73
  • 109
  • Note that on Windows 7 even administrators have a limited user token by default which represents roughly a normal user. You still have to start processes explicitly as administrator to get the elevated token. Or you can just declare that in your manifest or various other ways this can be handled. – Joey Oct 22 '11 at 23:45
  • Are you asking how to write a program which will grant the privilege, or how to use the Windows UI to grant the privilege, or how to use a script to grant the privilege? – John Saunders Oct 22 '11 at 23:50
  • 2
    I would imagine administrators are already granted that privilege, but it is disabled by default. You can enable it with AdjustTokenPrivileges(). – Luke Oct 23 '11 at 03:33
  • As I recently had this problem and it took me several hours to research I will attempt to provide a possible solution to future readers. If one were to run the Local Security Tool ( secpol.msc ) you can enable/disable the ability to change the system time for a given group. The Administrator group by default as it already enable, so you can enable it without a UAC Prompt ( default settings ) without an issue. – Security Hound Nov 30 '11 at 21:58
  • for Local Security Tool in Windows 10: open from Control Panel\System and Security\Administrative Tools\. Once Local Security Policy MMC is open, browse to Security Settings / Local Policies / User Rights Assignment and select Change the System Time. Default settings on my Windows 10 computer have granted this right to Admin and LOCAL SERVICE. Add additional users or groups as required. – user3085342 Apr 17 '17 at 03:59

0 Answers0