How to find the machine time on a remote pc.

Nathan

n00b
Joined
Apr 23, 2009
Messages
41
Ok so, I am working and was asked to make sure all the servers times updated. I cannot get into some of the serves as they are locked. Is there anyways I can just run a simple command instead of looking up all of the usernames and passwords for the servers.

Preferably something to run in a bat


Something like-
Ex: time /t (serverone)
 
well a few things you should clarify:

1. What OS do the servers run?
2. You mention the servers are locked...you mean physically or as you do not have user-rights on them?
3. You mention looking up username/passwords for them. What kind of a user management do you use? AD or something else? - I'm asking this so I'll figure out what is the best way to handle authentication duties for the script.

Anyway here is a simple powershell script (assuming you run win servers)

Code:
$a = gwmi Win32_LocalTime -computer 127.0.0.1;
[string]::Concat($a.Hour,":",$a.Minute)

just replace the localhost with whatever server name/ip you need

it is just a basic script and will output the time as: hour:minutes - can be customized of course
it will use your current authentication - this can also be changed
another simple modification can pull all the servers from a list and go through all of them

so let us know in more details what you need
 
Back
Top