Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista Tutorial - Synchornize date script

Reply
 
Old 06-25-2009   #1 (permalink)
Jose
Guest


 
 

Synchornize date script

Hi people,

Im having the following problem:
I have a network with my server but the client computers are not in AD, the problem Im having is that some of them have
problems with the dates, which is very critical due to my database application.Im trying to synchronize the computers with my
server. All my users are local users and they are restrictive users, meaning that they cant change the date.

I was trying to use a logon script with net time \\servername /set /y , but this only work with administrative rights, I tried all I know to make
this script work with my local users.

Is there any parameters that can make this script to run with normal user?
Im really desperate wit this.
Thanks in advance

--
NNTP.hk - (^(oo)^)
http://www.nntp.hk/web/


My System SpecsSystem Spec
Old 06-25-2009   #2 (permalink)
Pegasus [MVP]
Guest


 
 

Re: Synchornize date script


"Jose" <hola@xxxxxx> wrote in message
news:%23doa2Ya9JHA.4168@xxxxxx
Quote:

> Hi people,
>
> Im having the following problem:
> I have a network with my server but the client computers are not in AD,
> the problem Im having is that some of them have
> problems with the dates, which is very critical due to my database
> application.Im trying to synchronize the computers with my
> server. All my users are local users and they are restrictive users,
> meaning that they cant change the date.
>
> I was trying to use a logon script with net time \\servername /set /y ,
> but this only work with administrative rights, I tried all I know to make
> this script work with my local users.
>
> Is there any parameters that can make this script to run with normal user?
> Im really desperate wit this.
> Thanks in advance
>
> --
> NNTP.hk - (^(oo)^)
> http://www.nntp.hk/web/
Instead of synchronising my client PCs with my server I would synchronise
all of them with an external time source, using the inbuilt "Windows Time".
In this way all machines would show correct time at all times, independently
of any script.


My System SpecsSystem Spec
Old 06-25-2009   #3 (permalink)
Richard Mueller [MVP]
Guest


 
 

Re: Synchornize date script


"Pegasus [MVP]" <news@xxxxxx> wrote in message
news:eCJuy2a9JHA.5040@xxxxxx
Quote:

>
> "Jose" <hola@xxxxxx> wrote in message
> news:%23doa2Ya9JHA.4168@xxxxxx
Quote:

>> Hi people,
>>
>> Im having the following problem:
>> I have a network with my server but the client computers are not in AD,
>> the problem Im having is that some of them have
>> problems with the dates, which is very critical due to my database
>> application.Im trying to synchronize the computers with my
>> server. All my users are local users and they are restrictive users,
>> meaning that they cant change the date.
>>
>> I was trying to use a logon script with net time \\servername /set /y ,
>> but this only work with administrative rights, I tried all I know to make
>> this script work with my local users.
>>
>> Is there any parameters that can make this script to run with normal
>> user?
>> Im really desperate wit this.
>> Thanks in advance
>>
>> --
>> NNTP.hk - (^(oo)^)
>> http://www.nntp.hk/web/
>
> Instead of synchronising my client PCs with my server I would synchronise
> all of them with an external time source, using the inbuilt "Windows
> Time". In this way all machines would show correct time at all times,
> independently of any script.
>
As noted, the recommended approach is to configure PC's to synchronize with
external time source. This kb article should help:

http://support.microsoft.com/kb/307897

The least safe approach is to use logon scripts, as you must use alternate
credentials which exposes the administrator password. If you have no
connections to Internet, another approach might be to run a script yourself
(as a member of local Administrators group on each computer) that connects
to each computer remotely and synchronizes the time. Even here, however, it
would be better to have each computer automatically synchronize with one
reliable computer in the workgroup, so they all agree.

--
Richard Mueller
MVP Directory Services
Hilltop Lab - http://www.rlmueller.net
--


My System SpecsSystem Spec
Old 06-25-2009   #4 (permalink)
Jose
Guest


 
 

Re: Synchornize date script

Richard Mueller [MVP] wrote:
Quote:

> "Pegasus [MVP]" <news@xxxxxx> wrote in message
> news:eCJuy2a9JHA.5040@xxxxxx
Quote:

>> "Jose" <hola@xxxxxx> wrote in message
>> news:%23doa2Ya9JHA.4168@xxxxxx
Quote:

>>> Hi people,
>>>
>>> Im having the following problem:
>>> I have a network with my server but the client computers are not in AD,
>>> the problem Im having is that some of them have
>>> problems with the dates, which is very critical due to my database
>>> application.Im trying to synchronize the computers with my
>>> server. All my users are local users and they are restrictive users,
>>> meaning that they cant change the date.
>>>
>>> I was trying to use a logon script with net time \\servername /set /y ,
>>> but this only work with administrative rights, I tried all I know to make
>>> this script work with my local users.
>>>
>>> Is there any parameters that can make this script to run with normal
>>> user?
>>> Im really desperate wit this.
>>> Thanks in advance
>>>
>>> --
>>> NNTP.hk - (^(oo)^)
>>> http://www.nntp.hk/web/
>> Instead of synchronising my client PCs with my server I would synchronise
>> all of them with an external time source, using the inbuilt "Windows
>> Time". In this way all machines would show correct time at all times,
>> independently of any script.
>>
>
> As noted, the recommended approach is to configure PC's to synchronize with
> external time source. This kb article should help:
>
> http://support.microsoft.com/kb/307897
>
> The least safe approach is to use logon scripts, as you must use alternate
> credentials which exposes the administrator password. If you have no
> connections to Internet, another approach might be to run a script yourself
> (as a member of local Administrators group on each computer) that connects
> to each computer remotely and synchronizes the time. Even here, however, it
> would be better to have each computer automatically synchronize with one
> reliable computer in the workgroup, so they all agree.
>
Thank you very much for your response, these computers doesnt have
Internet connections, so I cant synchronize with an external source,
that´s why I want to do it to my local server, which, by the way has
Internet connection.

Im not an expert in scripting but how can I do this ¨run a script
yourself (as a member of local Administrators group on each computer)
that connects to each computer remotely and synchronizes the time.¨

Thank you a lot for your responses.
My System SpecsSystem Spec
Old 06-25-2009   #5 (permalink)
Pegasus [MVP]
Guest


 
 

Re: Synchornize date script


"Jose" <hola@xxxxxx> wrote in message
news:OJ2kAbb9JHA.2872@xxxxxx
Quote:

> Richard Mueller [MVP] wrote:
Quote:

>> "Pegasus [MVP]" <news@xxxxxx> wrote in message
>> news:eCJuy2a9JHA.5040@xxxxxx
Quote:

>>> "Jose" <hola@xxxxxx> wrote in message
>>> news:%23doa2Ya9JHA.4168@xxxxxx
>>>> Hi people,
>>>>
>>>> Im having the following problem:
>>>> I have a network with my server but the client computers are not in AD,
>>>> the problem Im having is that some of them have
>>>> problems with the dates, which is very critical due to my database
>>>> application.Im trying to synchronize the computers with my
>>>> server. All my users are local users and they are restrictive users,
>>>> meaning that they cant change the date.
>>>>
>>>> I was trying to use a logon script with net time \\servername /set /y ,
>>>> but this only work with administrative rights, I tried all I know to
>>>> make
>>>> this script work with my local users.
>>>>
>>>> Is there any parameters that can make this script to run with normal
>>>> user?
>>>> Im really desperate wit this.
>>>> Thanks in advance
>>>>
>>>> --
>>>> NNTP.hk - (^(oo)^)
>>>> http://www.nntp.hk/web/
>>> Instead of synchronising my client PCs with my server I would
>>> synchronise all of them with an external time source, using the inbuilt
>>> "Windows Time". In this way all machines would show correct time at all
>>> times, independently of any script.
>>>
>>
>> As noted, the recommended approach is to configure PC's to synchronize
>> with external time source. This kb article should help:
>>
>> http://support.microsoft.com/kb/307897
>>
>> The least safe approach is to use logon scripts, as you must use
>> alternate credentials which exposes the administrator password. If you
>> have no connections to Internet, another approach might be to run a
>> script yourself (as a member of local Administrators group on each
>> computer) that connects to each computer remotely and synchronizes the
>> time. Even here, however, it would be better to have each computer
>> automatically synchronize with one reliable computer in the workgroup, so
>> they all agree.
>>
> Thank you very much for your response, these computers doesnt have
> Internet connections, so I cant synchronize with an external source,
> that´s why I want to do it to my local server, which, by the way has
> Internet connection.
>
> Im not an expert in scripting but how can I do this ¨run a script yourself
> (as a member of local Administrators group on each computer) that connects
> to each computer remotely and synchronizes the time.¨
>
> Thank you a lot for your responses.
The simplest way is probably to create a scheduled task on each workstation.
It should run once every day and also at logon time and it should execute
this command:

net time \\Server /set /yes

You need to run the task under a local account with admin privileges (e.g.
"schedule").


My System SpecsSystem Spec
Old 06-25-2009   #6 (permalink)
Jose
Guest


 
 

Re: Synchornize date script

I have tried all these and nothing, the hour doesnt change, and it is
because the user doesnt have permission to modify the date, because with
a user with admin rights, the script works just fine.

Any other suggestion?

Thank you


Pegasus [MVP] wrote:
Quote:

> "Jose" <hola@xxxxxx> wrote in message
> news:OJ2kAbb9JHA.2872@xxxxxx
Quote:

>> Richard Mueller [MVP] wrote:
Quote:

>>> "Pegasus [MVP]" <news@xxxxxx> wrote in message
>>> news:eCJuy2a9JHA.5040@xxxxxx
>>>> "Jose" <hola@xxxxxx> wrote in message
>>>> news:%23doa2Ya9JHA.4168@xxxxxx
>>>>> Hi people,
>>>>>
>>>>> Im having the following problem:
>>>>> I have a network with my server but the client computers are not in AD,
>>>>> the problem Im having is that some of them have
>>>>> problems with the dates, which is very critical due to my database
>>>>> application.Im trying to synchronize the computers with my
>>>>> server. All my users are local users and they are restrictive users,
>>>>> meaning that they cant change the date.
>>>>>
>>>>> I was trying to use a logon script with net time \\servername /set /y ,
>>>>> but this only work with administrative rights, I tried all I know to
>>>>> make
>>>>> this script work with my local users.
>>>>>
>>>>> Is there any parameters that can make this script to run with normal
>>>>> user?
>>>>> Im really desperate wit this.
>>>>> Thanks in advance
>>>>>
>>>>> --
>>>>> NNTP.hk - (^(oo)^)
>>>>> http://www.nntp.hk/web/
>>>> Instead of synchronising my client PCs with my server I would
>>>> synchronise all of them with an external time source, using the inbuilt
>>>> "Windows Time". In this way all machines would show correct time at all
>>>> times, independently of any script.
>>>>
>>> As noted, the recommended approach is to configure PC's to synchronize
>>> with external time source. This kb article should help:
>>>
>>> http://support.microsoft.com/kb/307897
>>>
>>> The least safe approach is to use logon scripts, as you must use
>>> alternate credentials which exposes the administrator password. If you
>>> have no connections to Internet, another approach might be to run a
>>> script yourself (as a member of local Administrators group on each
>>> computer) that connects to each computer remotely and synchronizes the
>>> time. Even here, however, it would be better to have each computer
>>> automatically synchronize with one reliable computer in the workgroup, so
>>> they all agree.
>>>
>> Thank you very much for your response, these computers doesnt have
>> Internet connections, so I cant synchronize with an external source,
>> that´s why I want to do it to my local server, which, by the way has
>> Internet connection.
>>
>> Im not an expert in scripting but how can I do this ¨run a script yourself
>> (as a member of local Administrators group on each computer) that connects
>> to each computer remotely and synchronizes the time.¨
>>
>> Thank you a lot for your responses.
>
> The simplest way is probably to create a scheduled task on each workstation.
> It should run once every day and also at logon time and it should execute
> this command:
>
> net time \\Server /set /yes
>
> You need to run the task under a local account with admin privileges (e.g.
> "schedule").
>
>
My System SpecsSystem Spec
Old 06-25-2009   #7 (permalink)
Pegasus [MVP]
Guest


 
 

Re: Synchornize date script

It seems you missed my point:
**********
You need to run the task under a local account with admin privileges (e.g.
"schedule").
**********
This works - guaranteed! If you cannot get it to work then please post the
following details:
- The exact command line you use in the Task Scheduler.
- The name of the local account you use to run the scheduled job.
- The group memberships of this account. The command "net user xxx" will
tell you (replace xxx with the actual account name)


"Jose" <hola@xxxxxx> wrote in message
news:OzE7dmd9JHA.4944@xxxxxx
Quote:

>I have tried all these and nothing, the hour doesnt change, and it is
>because the user doesnt have permission to modify the date, because with a
>user with admin rights, the script works just fine.
>
> Any other suggestion?
>
> Thank you
>
>
> Pegasus [MVP] wrote:
Quote:

>> "Jose" <hola@xxxxxx> wrote in message
>> news:OJ2kAbb9JHA.2872@xxxxxx
Quote:

>>> Richard Mueller [MVP] wrote:
>>>> "Pegasus [MVP]" <news@xxxxxx> wrote in message
>>>> news:eCJuy2a9JHA.5040@xxxxxx
>>>>> "Jose" <hola@xxxxxx> wrote in message
>>>>> news:%23doa2Ya9JHA.4168@xxxxxx
>>>>>> Hi people,
>>>>>>
>>>>>> Im having the following problem:
>>>>>> I have a network with my server but the client computers are not in
>>>>>> AD, the problem Im having is that some of them have
>>>>>> problems with the dates, which is very critical due to my database
>>>>>> application.Im trying to synchronize the computers with my
>>>>>> server. All my users are local users and they are restrictive users,
>>>>>> meaning that they cant change the date.
>>>>>>
>>>>>> I was trying to use a logon script with net time \\servername /set /y
>>>>>> , but this only work with administrative rights, I tried all I know
>>>>>> to make
>>>>>> this script work with my local users.
>>>>>>
>>>>>> Is there any parameters that can make this script to run with normal
>>>>>> user?
>>>>>> Im really desperate wit this.
>>>>>> Thanks in advance
>>>>>>
>>>>>> --
>>>>>> NNTP.hk - (^(oo)^)
>>>>>> http://www.nntp.hk/web/
>>>>> Instead of synchronising my client PCs with my server I would
>>>>> synchronise all of them with an external time source, using the
>>>>> inbuilt "Windows Time". In this way all machines would show correct
>>>>> time at all times, independently of any script.
>>>>>
>>>> As noted, the recommended approach is to configure PC's to synchronize
>>>> with external time source. This kb article should help:
>>>>
>>>> http://support.microsoft.com/kb/307897
>>>>
>>>> The least safe approach is to use logon scripts, as you must use
>>>> alternate credentials which exposes the administrator password. If you
>>>> have no connections to Internet, another approach might be to run a
>>>> script yourself (as a member of local Administrators group on each
>>>> computer) that connects to each computer remotely and synchronizes the
>>>> time. Even here, however, it would be better to have each computer
>>>> automatically synchronize with one reliable computer in the workgroup,
>>>> so they all agree.
>>>>
>>> Thank you very much for your response, these computers doesnt have
>>> Internet connections, so I cant synchronize with an external source,
>>> that´s why I want to do it to my local server, which, by the way has
>>> Internet connection.
>>>
>>> Im not an expert in scripting but how can I do this ¨run a script
>>> yourself (as a member of local Administrators group on each computer)
>>> that connects to each computer remotely and synchronizes the time.¨
>>>
>>> Thank you a lot for your responses.
>>
>> The simplest way is probably to create a scheduled task on each
>> workstation. It should run once every day and also at logon time and it
>> should execute this command:
>>
>> net time \\Server /set /yes
>>
>> You need to run the task under a local account with admin privileges
>> (e.g. "schedule").

My System SpecsSystem Spec
Old 06-25-2009   #8 (permalink)
Richard Mueller [MVP]
Guest


 
 

Re: Synchornize date script

I believe that once the clients are configured to synch with your server,
they should all agree on the time. It would be up to you to maintain the
time on the server. Check the command line help for the w32tm command. At a
command prompt type:

w32tm /?

We lack experience with this because we have domains and time is configured
automatically. I believe you can get remote computer "MyComputer" to synch
it's time with the command:

w32tm /resync /computer:MyComputer

You can use a comma delimited list of computer names in place of
"MyComputer". And, you can configure the computer(s) to synch with your
server MyServer with a command similar to:

w32tm /config /computer:MyComputer /manualpeerlist:MyServer

You may then need to use:

w32tm /config /computer:MyComputer /update

Again, I don't have a workgroup to test this, and all of my computers are in
synch automatically. This link may help:

http://technet.microsoft.com/en-us/l.../bb491016.aspx

This is a far better solution than scripting a periodic synch, as the time
service will thereafter take care of it for you.
--
Richard Mueller
MVP Directory Services
Hilltop Lab - http://www.rlmueller.net
--

"Jose" <hola@xxxxxx> wrote in message
news:OzE7dmd9JHA.4944@xxxxxx
Quote:

>I have tried all these and nothing, the hour doesnt change, and it is
>because the user doesnt have permission to modify the date, because with a
>user with admin rights, the script works just fine.
>
> Any other suggestion?
>
> Thank you
>
>
> Pegasus [MVP] wrote:
Quote:

>> "Jose" <hola@xxxxxx> wrote in message
>> news:OJ2kAbb9JHA.2872@xxxxxx
Quote:

>>> Richard Mueller [MVP] wrote:
>>>> "Pegasus [MVP]" <news@xxxxxx> wrote in message
>>>> news:eCJuy2a9JHA.5040@xxxxxx
>>>>> "Jose" <hola@xxxxxx> wrote in message
>>>>> news:%23doa2Ya9JHA.4168@xxxxxx
>>>>>> Hi people,
>>>>>>
>>>>>> Im having the following problem:
>>>>>> I have a network with my server but the client computers are not in
>>>>>> AD, the problem Im having is that some of them have
>>>>>> problems with the dates, which is very critical due to my database
>>>>>> application.Im trying to synchronize the computers with my
>>>>>> server. All my users are local users and they are restrictive users,
>>>>>> meaning that they cant change the date.
>>>>>>
>>>>>> I was trying to use a logon script with net time \\servername /set /y
>>>>>> , but this only work with administrative rights, I tried all I know
>>>>>> to make
>>>>>> this script work with my local users.
>>>>>>
>>>>>> Is there any parameters that can make this script to run with normal
>>>>>> user?
>>>>>> Im really desperate wit this.
>>>>>> Thanks in advance
>>>>>>
>>>>>> --
>>>>>> NNTP.hk - (^(oo)^)
>>>>>> http://www.nntp.hk/web/
>>>>> Instead of synchronising my client PCs with my server I would
>>>>> synchronise all of them with an external time source, using the
>>>>> inbuilt "Windows Time". In this way all machines would show correct
>>>>> time at all times, independently of any script.
>>>>>
>>>> As noted, the recommended approach is to configure PC's to synchronize
>>>> with external time source. This kb article should help:
>>>>
>>>> http://support.microsoft.com/kb/307897
>>>>
>>>> The least safe approach is to use logon scripts, as you must use
>>>> alternate credentials which exposes the administrator password. If you
>>>> have no connections to Internet, another approach might be to run a
>>>> script yourself (as a member of local Administrators group on each
>>>> computer) that connects to each computer remotely and synchronizes the
>>>> time. Even here, however, it would be better to have each computer
>>>> automatically synchronize with one reliable computer in the workgroup,
>>>> so they all agree.
>>>>
>>> Thank you very much for your response, these computers doesnt have
>>> Internet connections, so I cant synchronize with an external source,
>>> that´s why I want to do it to my local server, which, by the way has
>>> Internet connection.
>>>
>>> Im not an expert in scripting but how can I do this ¨run a script
>>> yourself (as a member of local Administrators group on each computer)
>>> that connects to each computer remotely and synchronizes the time.¨
>>>
>>> Thank you a lot for your responses.
>>
>> The simplest way is probably to create a scheduled task on each
>> workstation. It should run once every day and also at logon time and it
>> should execute this command:
>>
>> net time \\Server /set /yes
>>
>> You need to run the task under a local account with admin privileges
>> (e.g. "schedule").

My System SpecsSystem Spec
Old 06-25-2009   #9 (permalink)
Jose
Guest


 
 

Re: Synchornize date script

First thanks Pegasus for you support, here it is what Im doing so far:

I create an account called schedule, as administrator.
Im going to scheduled tasks and in the task wizard I look for my .bat
file that contains the command ¨net time \\server /set /yes¨ and Im
scheduling every day and I also marked ¨every time I logon¨ and then I
put my schedule account credentials.
I enter as my normal user account but nothing happends, Am I doing
something wrong?
Again thanks.

Pegasus [MVP] wrote:
Quote:

> It seems you missed my point:
> **********
> You need to run the task under a local account with admin privileges (e.g.
> "schedule").
> **********
> This works - guaranteed! If you cannot get it to work then please post the
> following details:
> - The exact command line you use in the Task Scheduler.
> - The name of the local account you use to run the scheduled job.
> - The group memberships of this account. The command "net user xxx" will
> tell you (replace xxx with the actual account name)
>
>
> "Jose" <hola@xxxxxx> wrote in message
> news:OzE7dmd9JHA.4944@xxxxxx
Quote:

>> I have tried all these and nothing, the hour doesnt change, and it is
>> because the user doesnt have permission to modify the date, because with a
>> user with admin rights, the script works just fine.
>>
>> Any other suggestion?
>>
>> Thank you
>>
>>
>> Pegasus [MVP] wrote:
Quote:

>>> "Jose" <hola@xxxxxx> wrote in message
>>> news:OJ2kAbb9JHA.2872@xxxxxx
>>>> Richard Mueller [MVP] wrote:
>>>>> "Pegasus [MVP]" <news@xxxxxx> wrote in message
>>>>> news:eCJuy2a9JHA.5040@xxxxxx
>>>>>> "Jose" <hola@xxxxxx> wrote in message
>>>>>> news:%23doa2Ya9JHA.4168@xxxxxx
>>>>>>> Hi people,
>>>>>>>
>>>>>>> Im having the following problem:
>>>>>>> I have a network with my server but the client computers are not in
>>>>>>> AD, the problem Im having is that some of them have
>>>>>>> problems with the dates, which is very critical due to my database
>>>>>>> application.Im trying to synchronize the computers with my
>>>>>>> server. All my users are local users and they are restrictive users,
>>>>>>> meaning that they cant change the date.
>>>>>>>
>>>>>>> I was trying to use a logon script with net time \\servername /set /y
>>>>>>> , but this only work with administrative rights, I tried all I know
>>>>>>> to make
>>>>>>> this script work with my local users.
>>>>>>>
>>>>>>> Is there any parameters that can make this script to run with normal
>>>>>>> user?
>>>>>>> Im really desperate wit this.
>>>>>>> Thanks in advance
>>>>>>>
>>>>>>> --
>>>>>>> NNTP.hk - (^(oo)^)
>>>>>>> http://www.nntp.hk/web/
>>>>>> Instead of synchronising my client PCs with my server I would
>>>>>> synchronise all of them with an external time source, using the
>>>>>> inbuilt "Windows Time". In this way all machines would show correct
>>>>>> time at all times, independently of any script.
>>>>>>
>>>>> As noted, the recommended approach is to configure PC's to synchronize
>>>>> with external time source. This kb article should help:
>>>>>
>>>>> http://support.microsoft.com/kb/307897
>>>>>
>>>>> The least safe approach is to use logon scripts, as you must use
>>>>> alternate credentials which exposes the administrator password. If you
>>>>> have no connections to Internet, another approach might be to run a
>>>>> script yourself (as a member of local Administrators group on each
>>>>> computer) that connects to each computer remotely and synchronizes the
>>>>> time. Even here, however, it would be better to have each computer
>>>>> automatically synchronize with one reliable computer in the workgroup,
>>>>> so they all agree.
>>>>>
>>>> Thank you very much for your response, these computers doesnt have
>>>> Internet connections, so I cant synchronize with an external source,
>>>> that´s why I want to do it to my local server, which, by the way has
>>>> Internet connection.
>>>>
>>>> Im not an expert in scripting but how can I do this ¨run a script
>>>> yourself (as a member of local Administrators group on each computer)
>>>> that connects to each computer remotely and synchronizes the time.¨
>>>>
>>>> Thank you a lot for your responses.
>>> The simplest way is probably to create a scheduled task on each
>>> workstation. It should run once every day and also at logon time and it
>>> should execute this command:
>>>
>>> net time \\Server /set /yes
>>>
>>> You need to run the task under a local account with admin privileges
>>> (e.g. "schedule").
>
>
My System SpecsSystem Spec
Old 06-25-2009   #10 (permalink)
Pegasus [MVP]
Guest


 
 

Re: Synchornize date script

How do you know that nothing happens? Give yourself some eyes so that you
can see! Here is the batch file you should run while debugging this issue:
@echo off
echo %date% %time% %UserName% > c:\test.txt
net time \\server /set /yes 1>>c:\test.txt 2>>&1
echo %date% %time% >> c:\test.txt

Now log on as Administrator or as "schedule", then right-click the scheduled
task and run it. What does the file c:\test.txt contain after the job has
finished?

"Jose" <hola@xxxxxx> wrote in message
news:O4fTK9d9JHA.5040@xxxxxx
Quote:

> First thanks Pegasus for you support, here it is what Im doing so far:
>
> I create an account called schedule, as administrator.
> Im going to scheduled tasks and in the task wizard I look for my .bat file
> that contains the command ¨net time \\server /set /yes¨ and Im scheduling
> every day and I also marked ¨every time I logon¨ and then I put my
> schedule account credentials.
> I enter as my normal user account but nothing happends, Am I doing
> something wrong?
> Again thanks.
>
> Pegasus [MVP] wrote:
Quote:

>> It seems you missed my point:
>> **********
>> You need to run the task under a local account with admin privileges
>> (e.g. "schedule").
>> **********
>> This works - guaranteed! If you cannot get it to work then please post
>> the following details:
>> - The exact command line you use in the Task Scheduler.
>> - The name of the local account you use to run the scheduled job.
>> - The group memberships of this account. The command "net user xxx"
>> will tell you (replace xxx with the actual account name)
>>
>>
>> "Jose" <hola@xxxxxx> wrote in message
>> news:OzE7dmd9JHA.4944@xxxxxx
Quote:

>>> I have tried all these and nothing, the hour doesnt change, and it is
>>> because the user doesnt have permission to modify the date, because with
>>> a user with admin rights, the script works just fine.
>>>
>>> Any other suggestion?
>>>
>>> Thank you
>>>
>>>
>>> Pegasus [MVP] wrote:
>>>> "Jose" <hola@xxxxxx> wrote in message
>>>> news:OJ2kAbb9JHA.2872@xxxxxx
>>>>> Richard Mueller [MVP] wrote:
>>>>>> "Pegasus [MVP]" <news@xxxxxx> wrote in message
>>>>>> news:eCJuy2a9JHA.5040@xxxxxx
>>>>>>> "Jose" <hola@xxxxxx> wrote in message
>>>>>>> news:%23doa2Ya9JHA.4168@xxxxxx
>>>>>>>> Hi people,
>>>>>>>>
>>>>>>>> Im having the following problem:
>>>>>>>> I have a network with my server but the client computers are not in
>>>>>>>> AD, the problem Im having is that some of them have
>>>>>>>> problems with the dates, which is very critical due to my database
>>>>>>>> application.Im trying to synchronize the computers with my
>>>>>>>> server. All my users are local users and they are restrictive
>>>>>>>> users, meaning that they cant change the date.
>>>>>>>>
>>>>>>>> I was trying to use a logon script with net time \\servername /set
>>>>>>>> /y , but this only work with administrative rights, I tried all I
>>>>>>>> know to make
>>>>>>>> this script work with my local users.
>>>>>>>>
>>>>>>>> Is there any parameters that can make this script to run with
>>>>>>>> normal user?
>>>>>>>> Im really desperate wit this.
>>>>>>>> Thanks in advance
>>>>>>>>
>>>>>>>> --
>>>>>>>> NNTP.hk - (^(oo)^)
>>>>>>>> http://www.nntp.hk/web/
>>>>>>> Instead of synchronising my client PCs with my server I would
>>>>>>> synchronise all of them with an external time source, using the
>>>>>>> inbuilt "Windows Time". In this way all machines would show correct
>>>>>>> time at all times, independently of any script.
>>>>>>>
>>>>>> As noted, the recommended approach is to configure PC's to
>>>>>> synchronize with external time source. This kb article should help:
>>>>>>
>>>>>> http://support.microsoft.com/kb/307897
>>>>>>
>>>>>> The least safe approach is to use logon scripts, as you must use
>>>>>> alternate credentials which exposes the administrator password. If
>>>>>> you have no connections to Internet, another approach might be to run
>>>>>> a script yourself (as a member of local Administrators group on each
>>>>>> computer) that connects to each computer remotely and synchronizes
>>>>>> the time. Even here, however, it would be better to have each
>>>>>> computer automatically synchronize with one reliable computer in the
>>>>>> workgroup, so they all agree.
>>>>>>
>>>>> Thank you very much for your response, these computers doesnt have
>>>>> Internet connections, so I cant synchronize with an external source,
>>>>> that´s why I want to do it to my local server, which, by the way has
>>>>> Internet connection.
>>>>>
>>>>> Im not an expert in scripting but how can I do this ¨run a script
>>>>> yourself (as a member of local Administrators group on each computer)
>>>>> that connects to each computer remotely and synchronizes the time.¨
>>>>>
>>>>> Thank you a lot for your responses.
>>>> The simplest way is probably to create a scheduled task on each
>>>> workstation. It should run once every day and also at logon time and it
>>>> should execute this command:
>>>>
>>>> net time \\Server /set /yes
>>>>
>>>> You need to run the task under a local account with admin privileges
>>>> (e.g. "schedule").
>>
My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
script to determine password expire date and send email notificati PowerShell
powershell script help - recursive delete based on modified date PowerShell
set folder date script VB Script
Re: PS Script to automate checking date of file and delete if old PowerShell
script to verify date/time PowerShell


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46