Solved

RUNAS Command syntax in login script.

Posted on 2006-07-17
3
6,641 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 85

Expert Comment

by:oBdA
ID: 17121735
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
ID: 17121762
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
ID: 17122287
Many Thanks

David
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A project that enables an administrator to perform actions within a user session context not just at the time of login but any time later on day(s) or week(s) later.
A small collection of useful tips and tricks for Windows 10 users that I decided to write as a result of recent questions that were asked and answered at Experts Exchange. Two short video tutorials included. Enjoy..
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

691 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