Script that will write the time on all machines in the network to a file

EE,

   A large number of my workstation on my network did not take the daylight savings time setting. I am looking for a way to search the network and see what machines have the wrong time setting. Hoping there is a way to run a script to look at all machines and copy the machine name and the time it is showing.

We are running windows Xp on server 2003 servers.

Thanks in advance for your help.
/R
dh061
LVL 1
dh061Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

MaximumIQCommented:
Sorry I don't have time to tweak this for you. but take a look at this from the Scripting Guy
http://blogs.technet.com/b/heyscriptingguy/archive/2007/03/08/how-can-i-verify-the-system-time-on-a-remote-computer.aspx
0
TomasPCommented:
sysinternals (Microsoft) has a utility that is scriptable. You can read and set time and other things
http://forum.sysinternals.com/cannot-set-time-via-psexec_topic4236.html

You will see that you can read the time and set it if it is incorrect and you just need to fill in the pc name
0
pnormsCommented:
Here is a bat that works nice just change:
"c:\temp\timelist.txt"
To the path you would like to output the list to
@echo off
SETLOCAL ENABLEDELAYEDEXPANSION
cls
for /f %%c in ('dsquery computer -limit 3000 -o rdn') do @(
REM CHANGE 3000 ABOVE TO LIMIT OF PCS
    net time \\%%~c >nul
    if !errorlevel!==0 (
        for /f "tokens=6,7 delims= " %%i in ('net time \\%%~c') do echo %%~c - %%i - %%j >> "c:\temp\timelist.txt"
    )
)
cls
echo All Done
pause

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
The 7 Worst Nightmares of a Sysadmin

Fear not! To defend your business’ IT systems we’re going to shine a light on the seven most sinister terrors that haunt sysadmins. That way you can be sure there’s nothing in your stack waiting to go bump in the night.

pnormsCommented:
And if you have more than 3000 machines in your domain increase line4 3000 to whatever
0
pnormsCommented:
It can take some time so you will want to be patient and wait until you see "All Done". I need not say that it has to be run as domain admin.
0
dh061Author Commented:
pnorms,

Running it now will let you know when it is complete.

Thanks for your time.
0
MarkieSCommented:
Can you not just synch to a DC time server?

http://support.microsoft.com/kb/307897
0
pnormsCommented:
Can you not just synch to a DC time server?
http://support.microsoft.com/kb/307897 


Thats what willl need to be done after they gather a list of the machines out of sync.
0
dh061Author Commented:
Thank you for this Bat file worked great. thanks!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
VB Script

From novice to tech pro — start learning today.