How to get the NTP server value from powershell for all of the non domain joined server ?


hi all,

got mixed environment of windows server 2003 , 2008 joined domain , of them not joined domain, how possible time server value server using powershell ? 

/* server support specialist */

try powershell script (save .ps1):

 

$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     } } 

make sure run script account has permissions on servers , in elevated session.

 


if found post helpful, please "vote helpful". if answered question, remember "mark answer".

rich prescott | mcitp, mcts, mcp

[blog] engineering efficiency | [twitter] @rich_prescott | [powershell gui] client system administration toolkit


Windows Server  >  Windows PowerShell



Comments

Popular posts from this blog

Error: 0x80073701 when trying to add Print Services Role in Windows 2012 Standard

Disconnecting from a Windows Server 2012 R2 file sharing session on a Windows 7,8,10 machine

Event ID 64,77,1008 Certificates Events Windows Server 2008, 2008R2