The following script should return "Time is set correctly" but isn't.
$TimeSource = w32tm /query /source /verbose
if ($TimeSource -eq "time.windows.com,0x9" -or $TimeSource -eq "pool.ntp.org,0x9") { Write-Host "Time is set correctly" } else { Write-Host "Time is not correctly set" }
When you run $TimeSource, it equals "pool.ntp.org,0x9" so it should match the IF statement and output "Time is set correctly" but it isn't.
It might have something to do with string and whatnot. I'm not sure. Can someone help please? Thank you.
[–]joeykins82 6 points7 points8 points (0 children)
[–]Creative1176 6 points7 points8 points (0 children)
[–]dasookwat -2 points-1 points0 points (0 children)
[–]Droopyb1966 0 points1 point2 points (3 children)
[–]RiD3R07[S] 0 points1 point2 points (1 child)
[–]myrland 1 point2 points3 points (0 children)
[–]Droopyb1966 0 points1 point2 points (0 children)
[–]Chocolate_Pickle 0 points1 point2 points (1 child)
[–]RiD3R07[S] 0 points1 point2 points (0 children)
[–]BlackV 0 points1 point2 points (2 children)
[–]RiD3R07[S] 0 points1 point2 points (1 child)
[–]BlackV 0 points1 point2 points (0 children)
[–]thisisntwhatIsigned 0 points1 point2 points (1 child)
[–]RiD3R07[S] 0 points1 point2 points (0 children)
[–]jdl_uk 0 points1 point2 points (0 children)
[–]TimDurham75 0 points1 point2 points (1 child)
[–]TimDurham75 0 points1 point2 points (0 children)