net time

  • Thread starter Thread starter shan
  • Start date Start date
S

shan

Hello,

I'm using batch script to change the clients pc time.
net time \\servername /yes /set but the clien't is logged
in as an user so the time doesn't change. It gives me the
user permission error. Can this be done using batch
script with the user rights instead of doing it through
global group policy. thanks in advace for any ideas.

Shan
 
Your users will need permission to change the time.
You can grant them permission through a batch script
using ntrights from the resource kit like this:

@echo off
cls

:DO
for /f %%p in (pc.lst) do call :TIME %%p goto :END
:END
exit
:TIME
echo Setting Time Permissions for PC: %1
ntrights -u "domain users" -m %1 +r SeSystemTimePrivilege >> timelog.txt



(pc.lst is simply a text file with a list of the computernames in your
domain.)


Another option is to use psexec from http://www.sysinternals.com.
You could write a batch to log into each machine as admin remotly and change
the time.
 
You can modify user rights with NTRIGHTS.EXE from the Windows 2000 Resource
Kit.

However - if your clients are all Windows 2000 or later, don't use NET TIME,
just use the built-in W32Time service. This will run as a service with
admin rights and talk to the domain controllers. If you are in an Active
Directory domain this should all be automatic.

Explain more about your environment, or why you are using NET TIME in the
first place.
 
Back
Top