KGRKJGETMRETU895U-589TY5MIGM5JGB5SDFESFREWTGR54TY
Server : Apache/2.4.58 (Win64) OpenSSL/3.1.3 PHP/8.2.12
System : Windows NT SERVER-PC 10.0 build 26200 (Windows 11) AMD64
User : ServerPC ( 0)
PHP Version : 8.2.12
Disable Function : NONE
Directory :  C:/Windows/diagnostics/scheduled/Maintenance/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : C:/Windows/diagnostics/scheduled/Maintenance/RS_SyncSystemTime.ps1
# Copyright � 2008, Microsoft Corporation. All rights reserved.

#Import-LocalizedData -BindingVariable localizationString -FileName CL_LocalizationData

#Write-DiagProgress -activity $localizationString.syncSystemTime_progress

#. .\CL_Utility.ps1

## function to get time synchronization type
#function GetTimeSyncType {
#    [string]$result = ""
#    [string]$registryKey = "HKLM:\SYSTEM\CurrentControlSet\Services\W32Time\Parameters"
#    [string]$registryKeyName = "Type"

#    if(Test-Path $registryKey) {
#        $registryEntry = Get-Item -Path $registryKey
#        if($null -ne $registryEntry) {
#            $result = $registryEntry.GetValue($registryKeyName)
#        }
#    }

#    return $result
#}

## function to update time synchronization type
#function UpdateTimeSyncType([string]$type) {
#    [string]$registryKey = "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Parameters"
#    [string]$registryKeyName = "Type"

#    [Microsoft.Win32.Registry]::SetValue($registryKey, $registryKeyName, $type)
#}

## function to restart w32time service
#function RestartW32timeService {
#    try {
#        Stop-Service w32time
#        WaitFor-ServiceStatus "w32time" ([ServiceProcess.ServiceControllerStatus]::Stopped)
#    } finally {
#        Start-Service w32time
#        WaitFor-ServiceStatus "w32time" ([ServiceProcess.ServiceControllerStatus]::Running)
#    }
#}

## Time sync (time.windows.com is the default Windows time server)
#if(Test-DomainJoined)
#{
#    if("NoSync" -eq (GetTimeSyncType)) {
#        UpdateTimeSyncType "NT5DS"
#    }
#    RestartW32timeService

#    w32tm.exe /resync /rediscover
#}
#else
#{
#    if("NoSync" -eq (GetTimeSyncType)) {
#        UpdateTimeSyncType "NTP"
#    }
#    RestartW32timeService

#    Update-TimeSource "time.windows.com"
#    w32tm.exe /resync /force
#}


Anon7 - 2021