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 */
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
Post a Comment