Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

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

Posted on 2011-09-04
6
509 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
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 
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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
The following article is intended as a guide to using PowerShell as a more versatile and reliable form of application detection in SCCM.
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 locating and launching the BEUtility application and how to execute it on the appropriate database. Log onto the server running the Backup Exec database. In a larger environment, this would generally be …

790 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