Submit a ticketCall us

Training Class Getting Started with SolarWinds Backup - February 28

This course offers customers an introduction to SolarWinds Backup, focusing on configuring the backup technology, taking backups, data restoration and data security. It is a great primer and will get you up to speed quickly on SolarWinds Backup.
Register for class.

Home > Success Center > Server & Application Monitor (SAM) > Server Clock Drift Template Fails on Agent Node in SAM

Server Clock Drift Template Fails on Agent Node in SAM

Updated January 2, 2018


This article details a resolution in regards to the failure of the "Server Clock Drift (PowerShell)" template to run on the Agent Node in SAM when the default polling method is set to "Agent".



  • SAM 6.4 or later


The following command works correctly only for agentless polling:

$remoteServerTime = Get-WmiObject Win32_UTCTime -ComputerName $


-Credential $




On an Agent node, the command fails because these credentials cannot be used for a local connection.


You can use a simpler script that receives the clock drift directly from the NTP server without the complicated mathematics necessary for remote polling:

$ntpServer = $args.get(0);
if (!$ntpServer)
    Write-Host "Message: Can't find ""ntpServer"" argument. Check documentation.";
    exit 1;
$ntpQuery = Invoke-Expression "w32tm /monitor /computers:$ntpServer" | Out-String;
$findSkew = [regex]"(?:NTP\: )(?<Value>[^s]+)";
if ($ntpQuery -match $findSkew)
    $ntpToLocalSkew = [double]::Parse($Matches['Value'])
    $roundedSkew = [math]::Round($ntpToLocalSkew, 2)
    Write-Host "Message: Clock drift: ${roundedSkew}s"
    Write-Host "Statistic: $([math]::Abs($roundedSkew))"
    exit 0
    Write-Host "Message: Unable to query NTP server $ntpServer."
    exit 1

If you need to contact Support about this issue, be sure to provide full logs from the main poller as well as the agent. Configure logging to increase the number of files to gather logs for a longer period of time for observation purposes.



Last modified