18 lines
947 B
PowerShell
18 lines
947 B
PowerShell
$timeSynchronizationServiceRef = $wsmanConnectionObject.NewReference("SELECT * FROM AMT_TimeSynchronizationService WHERE Name='Intel(r) AMT Time Synchronization Service'")
|
|
$ta0 = GetTimeSync
|
|
if($ta0 -ne $null)
|
|
{
|
|
$dateTime = [System.DateTime]"1/1/1970"
|
|
$tm1 = [System.DateTime]::UtcNow
|
|
$tm1 = New-TimeSpan -Start $dateTime -End $tm1
|
|
$tm1 = [System.Math]::Floor($tm1.TotalSeconds)
|
|
$tm2 = [System.DateTime]::UtcNow
|
|
$tm2 = New-TimeSpan -Start $dateTime -End $tm2
|
|
$tm2 = [System.Math]::Floor($tm2.TotalSeconds)
|
|
$inputObject = $timeSynchronizationServiceRef.CreateMethodInput("SetHighAccuracyTimeSynch")
|
|
$inputObject.SetProperty("Ta0", $ta0.ToString())
|
|
$inputObject.SetProperty("Tm1", $tm1.ToString())
|
|
$inputObject.SetProperty("Tm2", $tm2.ToString())
|
|
$outputObject = $timeSynchronizationServiceRef.InvokeMethod($inputObject)
|
|
$returnValue = $outputObject.GetProperty("ReturnValue")
|
|
} |