Solved

How to query Windows Server time server synch value using powershell ?

Posted on 2011-09-04
6
496 Views
Last Modified: 2012-06-27
Hi All,

I got mixed environment of Windows Server 2003 and 2008 that is not joined to the domain and some of them also joined to the domain, what I'd like to do is to get the time server value which this particular server currently in synch with using pwoershell.

Is it possible ?
0
Comment
6 Comments
 
LVL 13

Expert Comment

by:Felix Leven
ID: 36482647
Free:
http://poshcode.org/2604

Nice but, not free (get-time) Trial available^^:
http://www.powershellinside.com/powershell/netcmdlets/
0
 
LVL 26

Expert Comment

by:Leon Fester
ID: 36483252
Not sure what your problem is but "The W32Time service is not a full-featured NTP solution that meets time-sensitive application needs and is not supported by Microsoft as such."

Have a look at the following links to get a better understanding
How the Windows Time Service Works
http://technet.microsoft.com/en-us/library/cc773013(WS.10).aspx

Support boundary to configure the Windows Time service for high accuracy environments
http://support.microsoft.com/kb/939322
0
 
LVL 24

Expert Comment

by:Awinish
ID: 36483619
Why specific powershell. below link might help you.
http://technet.microsoft.com/en-us/library/ee332526.aspx

Regards
________________________________________
Awinish Vishwakarma
MY BLOG:  awinish.wordpress.com
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 3

Accepted Solution

by:
klalakomacoi earned 500 total points
ID: 36483649
Give this a go:

$servers = @('server01','server02')

foreach ($server in $servers){
$ntps = w32tm /query /computer:$server /configuration | ?{$_ -match 'ntpserver:'} | %{($_ -split ":\s\b")[1]}
new-object psobject -property @{
    Server = $Server
    NTPSource = $ntps
    }
}

Open in new window

0
 
LVL 7

Author Comment

by:Senior IT System Engineer
ID: 36483674
thanks people for the reply.

@klalakomacoi: how to execute this against DMZ VM which doesn't join the AD domain ?
0
 
LVL 3

Assisted Solution

by:klalakomacoi
klalakomacoi earned 500 total points
ID: 36485327

how to execute this against DMZ VM which doesn't join the AD domain?

yes in this case you would have to run it under a different security context (probably something like DMZSERVER\administrator).  Also given that this machine is on your DMZ you are probably traversing your firewall which is an added wrinkle.

If you are crossing a firewall you should probably read up on this: http://blogs.msdn.com/b/wmi/archive/2009/07/22/new-default-ports-for-ws-management-and-powershell-remoting.aspx
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Resolve DNS query failed errors for Exchange
Possible fixes for Windows 7 and Windows Server 2008 updating problem. Solutions mentioned are from Microsoft themselves. I started a case with them from our Microsoft Silver Partner option to open a case and get direct support from Microsoft. If s…
This tutorial will show how to push an installation of Backup Exec to an additional server in both 2012 and 2014 versions of the software. Click on the Backup Exec button in the upper left corner. From here, select Installation and Licensing, then I…
This tutorial will walk an individual through the steps necessary to configure their installation of BackupExec 2012 to use network shared disk space. Verify that the path to the shared storage is valid and that data can be written to that location:…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now