<< Back to Script Library

Test clock synchronization between multiple computers

This action is intended for detecting computers with misaligned system time. It is designed to be executed against a group of computers, comparing the difference between the current time and last midnight, by means of the built-in ControlUp SBA output comparison feature. If the clocks on all selected computers are in sync, you should get one output group.In a typical production-scale environment, a handful of computers may produce a non-standard output, which indicates a clock slip that probably causes authentication errors and other issues.
This script accounts for different time zones, so computers that are in sync but in different time zones should produce the same output.
Version: 2.5.7
Created: 2019-03-12
Modified: 2019-03-17
Creator: ek
Downloads: 114
Tags: authentication Kerberos local time NTP time sync
The Script Copy Script Copied to clipboard
$now = $(Get-Date).ToUniversalTime()
$begintoday = $(Get-Date -Hour 0 -Minute 0 -Second 0)
$timesincemidnight = New-TimeSpan -Start $begintoday -End $now
[int]$5minperiods = $timesincemidnight.TotalMinutes / 5
Write-Output "$5minperiods five-minute periods elapsed since midnight."
Write-Output "Please examine the groups of output generated by this script-based action"
Write-Output "All computers in sync (+/- 5 min) should appear in the same output group"