Detect Clock Skew - Script is not working

I imported the script " Detect Clock Skew" from the script library, but am unable to get it to work. Has anyone had any luck getting it going?

I changed the skew time to greater than 60 seconds, then set a test machine to around 5 minutes off and never received any kind of alert.

Seems to be working properly for me. What script output do you get?

I’m not getting any script output, just a blank white screen when I click the “Script Output” button.

Well, I’m not sure what has changed, but I’m running the script and getting the expected results.

Pretty sure its only looking at the number of Seconds. Try setting one off by 6 seconds and see if you get an alert. Seems to be working fine here as well on ~150 machines.

On a Server 2022 DC with PS 5.1.20348.859, I had the same problem. It wasn’t an issue of misunderstanding that seconds is the unit of measurement. The Skew variable wasn’t being processed as an integer, so the script was checking … $STRING -gt $INT and failing.

I forced the Detected Skew in the if statement to be an INT and all is well.

if ( [int]($DetectedSkew.Skew -replace '[^0-9.]') -gt $MaximumSkewInSeconds) {...}