Allow/Disallow a user from changing system time
-
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
-
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
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).
-
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
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.