Omid Samir

Omid Samir

Network Engineer, Virtualization Specialist & Datacenter Expert

Disable DST on Domain Network

Here’s a PowerShell script to disable Daylight Saving Time (DST) on domain network computers:

# Connect to Active Directory
Import-Module ActiveDirectory

# Get all domain computers
$computers = Get-ADComputer -Filter {OperatingSystem -like "*Windows*"} | Select-Object -ExpandProperty Name

# Loop through each computer and disable DST
foreach ($computer in $computers) {
# Disable DST
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\TimeZoneInformation" -Name "DisableAutoDaylightTimeSet" -Value 1 -ErrorAction SilentlyContinue -ComputerName $computer
}

This script first imports the ActiveDirectory module to connect to the Active Directory domain. It then gets all domain computers using the Get-ADComputer cmdlet and stores their names in the $computers variable.

Next, the script loops through each computer in the $computers variable and uses the Set-ItemProperty cmdlet to disable DST on that computer. This is done by setting the DisableAutoDaylightTimeSet registry value to 1 under the HKLM:\SYSTEM\CurrentControlSet\Control\TimeZoneInformation key.

Note that this script assumes that you have administrative access to all domain computers and that the computers are running a version of Windows that supports the DisableAutoDaylightTimeSet registry value. Also, running this script will permanently disable DST on the computers, so use it with caution.