Solved

RUNAS Command syntax in login script.

Posted on 2006-07-17
3
6,622 Views
Last Modified: 2013-12-28
(NT4 Domain & DCs, Clients - NT4, W2K, XP (server used for time syncronisation > W2K))

I am trying to configure time syncronisation through login scripts.   I have the following command in the login scripts at the moment;

net time \\servername /set /yes

This works fine, but only as administrator, and despite having changed Group Policy, the local settings still stops syncronisation with user permissions, (that's everyone but me).

Is it possible to use the RUNAS command to overcome this, such as;

runas /profile /user:domainname\administrator net time \\[server] /set /yes

Questions - Is the syntax correct?  Would it work? When the login script ran, would it ask for admin's password?

I know I could answer such questions through testing, but the underline problem of incorrect time on clients machines are effecting other services, and needs to be resolved ASAP.   I would appreciate your advice, Regards, David.
0
Comment
Question by:Dave-sysadm
3 Comments
 
LVL 82

Expert Comment

by:oBdA
Comment Utility
runas isn't available in NT4, and doing this in a logon script isn't such a good idea; it means that the time will only be synchronized when someone is logging on to the machine, which can be quite some time on a server.
On your W2k/XP clients, just open a command prompt and enter
net time /setsntp:IP.of.your.timeserver
net stop w32time
net start w32time

How to synchronize the time on a Windows 2000-based computer in a Windows NT 4.0 domain
http://support.microsoft.com/?kbid=258059

On your NT4 machines, install the w32time service, and let them synchronize with the W2k machine as well (downloadlink is in the article):
Changes to the W32Time and TimeServ Utilities
http://support.microsoft.com/?kbid=246145
0
 
LVL 28

Accepted Solution

by:
Michael Pfister earned 500 total points
Comment Utility
runas asks for the admin password, so this is no solution.
Easiest way is to give your users the "Adjust time" privilege.
Since you're an NT4 this can't be done via GPO, so you have to run a command for all of your workstations.
The command is ntrights.exe, available in the Microsoft Ressource Kit matching your OS.

Syntax is

ntrights -u Everyone +r SeSystemTimePrivilege -m \\<machine to perform the operation on>

After that, any user can adjust the system time by issuing a net time ...

Hope it helps,

Michael
0
 
LVL 1

Author Comment

by:Dave-sysadm
Comment Utility
Many Thanks

David
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Storage devices are generally used to save the data or sometime transfer the data from one computer system to another system. However, sometimes user accidentally erased their important data from the Storage devices. Users have to know how data reco…
Recently Microsoft released a brand new function called CONCAT. It's supposed to replace its predecessor CONCATENATE. But how does it work? And what's new? In this article, we take a closer look at all of this - we even included an exercise file for…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…
The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now