Solved

RUNAS Command syntax in login script.

Posted on 2006-07-17
3
6,624 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 83

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Update 11/3/2014 - Although the below article will get you to relocate the WINSXS folder, Microsoft has finally released a utility to reduce the size of the WINSXS folder. For some reason, it's not that straightforward. It only works on Windows 2008…
In this article, I will show you HOW TO: Install VMware Tools for Windows on a VMware Windows virtual machine on a VMware vSphere Hypervisor 6.5 (ESXi 6.5) Host Server, using the VMware Host Client. The virtual machine has Windows Server 2016 instal…
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…
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…

919 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

20 Experts available now in Live!

Get 1:1 Help Now