Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. System Admin
  4. Allow/Disallow a user from changing system time

Allow/Disallow a user from changing system time

Scheduled Pinned Locked Moved System Admin
csharpc++helptutorial
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Aseem Sharma
    wrote on last edited by
    #1

    Hi all, I am working on a feature where in we can allow/disallow changing system time to any user. We can run this application from an administrator's account and set if a particular user can change system time or not. Even the administrator (who itself is logged on) itself can allow/disallow himself changing time. While googling I found that there is some, The system user right SeSystemtimePrivilege that controls the ability to set the system time. I could not find how to complete my feature via the privilege SeSystemtimePrivilege using C#. Can somebody help me how to that using c# (or even C++). Even if there is some other way of implementing this feature, please let me know. Thanks in Advance Best Regards Aseem

    M 2 Replies Last reply
    0
    • A Aseem Sharma

      Hi all, I am working on a feature where in we can allow/disallow changing system time to any user. We can run this application from an administrator's account and set if a particular user can change system time or not. Even the administrator (who itself is logged on) itself can allow/disallow himself changing time. While googling I found that there is some, The system user right SeSystemtimePrivilege that controls the ability to set the system time. I could not find how to complete my feature via the privilege SeSystemtimePrivilege using C#. Can somebody help me how to that using c# (or even C++). Even if there is some other way of implementing this feature, please let me know. Thanks in Advance Best Regards Aseem

      M Offline
      M Offline
      Michel Godfroid
      wrote on last edited by
      #2

      You should call the Local Security Authority functions to assign privileges to a user (I don't think there is a .net interface, so you're stuck with C++) http://msdn.microsoft.com/en-us/library/ms721863(v=VS.85).aspx[^] the user calling this function must of course be part of the administrators group. Note that if the computer is in a domain, these privileges will probably be reset periodically (overwritten by the domain security policy, talk to your admin). Also if the computer is in a domain, changing the system time might impair the user's access to resources (the Kerberos security tokens have limited time validity, and must be renewed. Kerberos relies on all machines being synchronized to check the token validity).

      1 Reply Last reply
      0
      • A Aseem Sharma

        Hi all, I am working on a feature where in we can allow/disallow changing system time to any user. We can run this application from an administrator's account and set if a particular user can change system time or not. Even the administrator (who itself is logged on) itself can allow/disallow himself changing time. While googling I found that there is some, The system user right SeSystemtimePrivilege that controls the ability to set the system time. I could not find how to complete my feature via the privilege SeSystemtimePrivilege using C#. Can somebody help me how to that using c# (or even C++). Even if there is some other way of implementing this feature, please let me know. Thanks in Advance Best Regards Aseem

        M Offline
        M Offline
        Michel Godfroid
        wrote on last edited by
        #3

        Oh, and BTW, there's a gui to this stuff: just run run secpol.msc on the box where you want to assign the privilege. The "change system time" privilege is under Local Policies --UserRights Assignments ----Change the system time Same restrictions apply: in a domain this will get overwritten by the domain security policy. Talk to your admin if you want to change this on the domain level.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups