[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 536
  • Last Modified:

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

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
Senior IT System Engineer
Asked:
Senior IT System Engineer
2 Solutions
 
Felix LevenCommented:
Free:
http://poshcode.org/2604

Nice but, not free (get-time) Trial available^^:
http://www.powershellinside.com/powershell/netcmdlets/
0
 
Leon FesterCommented:
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
 
AwinishCommented:
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
Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.

 
klalakomacoiCommented:
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
 
Senior IT System EngineerIT ProfessionalAuthor Commented:
thanks people for the reply.

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

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

New Tabletop Appliances Blow Competitors Away!

WatchGuard’s new T15, T35 and T55 tabletop UTMs provide the highest-performing security inspection in their class, allowing users at small offices, home offices and distributed enterprises to experience blazing-fast Internet speeds without sacrificing enterprise-grade security.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now