Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Server > Scripting > Reading network time from a batch file ?

Reply
Thread Tools Display Modes

Reading network time from a batch file ?

 
 
tonyb61
Guest
Posts: n/a

 
      09-17-2009

I'm not sure if this is the correct newsgroup, if anyone can suggest a more
appropriate group I'll post to that ?

I'm writing a batch file to run on a vista machine, that among other tasks,
needs to read the time from our domain, which runs on a W2003 server.The
vista machines are on our network, but not logged into the domain.
So far the only way I've found, is to logon to the domain, connect to a
network drive on say the windows server, read the time, and disconnect drive
and logoff. This seems cumbersome, and as the batch file contains a username
and password, not too secure.
Is there a better way of doing this ? or maybe creating a user account that
has very limited capability, to allow me to read the time back into my batch
file ?

Thanks


 
Reply With Quote
 
 
 
 
Pegasus [MVP]
Guest
Posts: n/a

 
      09-17-2009

"tonyb61" <> wrote in message
news:u$...
> I'm not sure if this is the correct newsgroup, if anyone can suggest a
> more appropriate group I'll post to that ?
>
> I'm writing a batch file to run on a vista machine, that among other
> tasks, needs to read the time from our domain, which runs on a W2003
> server.The vista machines are on our network, but not logged into the
> domain.
> So far the only way I've found, is to logon to the domain, connect to a
> network drive on say the windows server, read the time, and disconnect
> drive and logoff. This seems cumbersome, and as the batch file contains a
> username and password, not too secure.
> Is there a better way of doing this ? or maybe creating a user account
> that has very limited capability, to allow me to read the time back into
> my batch file ?
>
> Thanks
>


Create a domain account/password that matches your local account/password,
then use the command below to set the local date/time.
net time \\server /set /y


 
Reply With Quote
 
tonyb61
Guest
Posts: n/a

 
      09-18-2009
"Pegasus [MVP]" <> wrote in message
news:...
>
> "tonyb61" <> wrote in message
> news:u$...
>> I'm not sure if this is the correct newsgroup, if anyone can suggest a
>> more appropriate group I'll post to that ?
>>
>> I'm writing a batch file to run on a vista machine, that among other
>> tasks, needs to read the time from our domain, which runs on a W2003
>> server.The vista machines are on our network, but not logged into the
>> domain.
>> So far the only way I've found, is to logon to the domain, connect to a
>> network drive on say the windows server, read the time, and disconnect
>> drive and logoff. This seems cumbersome, and as the batch file contains a
>> username and password, not too secure.
>> Is there a better way of doing this ? or maybe creating a user account
>> that has very limited capability, to allow me to read the time back into
>> my batch file ?
>>
>> Thanks
>>

>
> Create a domain account/password that matches your local account/password,
> then use the command below to set the local date/time.
> net time \\server /set /y


This is in effect what I do now, but as I said this means that I put a
username and password in the batch file in clear text which allows access to
the domain if the file is read by anyone ? The batch file is not secure.
Regards
Tony


 
Reply With Quote
 
Pegasus [MVP]
Guest
Posts: n/a

 
      09-18-2009

"tonyb61" <> wrote in message
news:%...
> "Pegasus [MVP]" <> wrote in message
> news:...
>>
>> "tonyb61" <> wrote in message
>> news:u$...
>>> I'm not sure if this is the correct newsgroup, if anyone can suggest a
>>> more appropriate group I'll post to that ?
>>>
>>> I'm writing a batch file to run on a vista machine, that among other
>>> tasks, needs to read the time from our domain, which runs on a W2003
>>> server.The vista machines are on our network, but not logged into the
>>> domain.
>>> So far the only way I've found, is to logon to the domain, connect to a
>>> network drive on say the windows server, read the time, and disconnect
>>> drive and logoff. This seems cumbersome, and as the batch file contains
>>> a username and password, not too secure.
>>> Is there a better way of doing this ? or maybe creating a user account
>>> that has very limited capability, to allow me to read the time back into
>>> my batch file ?
>>>
>>> Thanks
>>>

>>
>> Create a domain account/password that matches your local
>> account/password, then use the command below to set the local date/time.
>> net time \\server /set /y

>
> This is in effect what I do now, but as I said this means that I put a
> username and password in the batch file in clear text which allows access
> to the domain if the file is read by anyone ? The batch file is not
> secure.
> Regards
> Tony


I did not say that you should include an account name & password into a
batch file. I said that you should create a domain account/password that
matches the account/password under which the batch file runs. When you do
this then there is no need to supply any credentials while the batch file
runs.


 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Batch file - add network printers via printui.dll, PrintUIEntry Pegasus \(MVP\) Scripting 4 07-30-2008 05:37 PM
Re: Reading from file - batch Jeffery Hicks [MVP] Scripting 2 11-12-2007 06:10 PM
Mapping/Unmapping Network Drives using batch file on 2k3 Srv Henry Marquez Scripting 1 03-31-2005 03:53 PM
Creating a batch file to backup files to network clynch Active Directory 0 03-10-2005 05:17 PM
Reading from a batch file newtechie74 Scripting 1 01-11-2005 03:47 PM



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 47 48 49 50 51 52 53 54 55 56 57 58 59