Solved

Disable Time Sync on Windows server on Domain

Posted on 2016-07-27
8
79 Views
Last Modified: 2016-07-28
I have a supplier of software who wants to test some date related functions within MS SQL2008R2
Their stored procedures use GETDATE() and GETUTCDATE() to get the date, which reads from the underlying Windows 2012 server with MSSQL.

Their solution is to change the system date on the SQL server whenever they want to do their testing of date functions.

However, the Active Directory, quite rightly, changes the system time back to the correct PDC emulator time within 10-20 minutes.

Ive tried moving the AD object into a Test OU and block all Group Policy inheritence to ensure it isnt a GPO that is changing the time

Is there anyway, apart from dropping the server off the domain, that I can stop the Windows 2012 server from syncing its time from the Active Directory?
The server needs to remain on the domain for other parts of the software testing.
0
Comment
Question by:HBS-Mach
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 14

Expert Comment

by:Kaffiend
ID: 41732159
Kerberos, which AD uses, will break within 5 minutes or so of time discrepancy (default value, you can change to other than 5 minutes)

So, if you don't need any kind of authentication or security tokens, you might be able to get away with doing this.

A registry change to make the server use itself as a time source would probably work (but remember to keep in mind my first 2 statements)
0
 
LVL 1

Author Comment

by:HBS-Mach
ID: 41732165
Hi Kaffiend,

I understand that we will break the ability to login with a domain account while the time is incorrect.
The idea is that just during the testing, the date is changed.
They DO NOT log out of the machine while the date is incorrect.
They change it back to correct time before they logout

A reboot or logging in with a local account to re-adjust the time will allow domain accounts to log back in, if they forget to change it or get booted off for some reason.

What would the registry change be to set the server as its own time source?
0
 
LVL 14

Assisted Solution

by:Kaffiend
Kaffiend earned 200 total points
ID: 41732180
Sorry I don't remember what the change is.  It's in notes that I have kept through the years but it's at home and thus, not handy   : (

This article (even easier than regedit) will help you achieve the same thing:
https://technet.microsoft.com/en-us/library/cc757721(v=ws.10).aspx
0
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 
LVL 41

Accepted Solution

by:
Adam Brown earned 250 total points
ID: 41732207
Go to CMD, run the following:

w32tm /config /syncfromflags:no /update

Open in new window


That will set the w32tm service to stop syncing. Running this will return it to normal:

w32tm /config /syncfromflags:domhier /update

Open in new window

0
 
LVL 1

Author Comment

by:HBS-Mach
ID: 41732390
Thanks all.
I will give these a go and get back to you tomorrow.
0
 
LVL 85

Assisted Solution

by:oBdA
oBdA earned 50 total points
ID: 41732403
You will not want to reconfigure the time service for that; that change is permanent, so if for whatever reason the change isn't undone, a reboot won't cure the problem.
If they continue with that, it's best to just stop (and I mean "Stop", not set to "Disabled") the time service, either with services.msc (Windows Time), or in an elevated command prompt or Powershell: net.exe stop W32Time.

That said, instead of changing the system time, they should consider using a wrapper function to get the time, and set the wrapper function to either return the true time or an offset time based on whatever debugging arguments they need.
0
 
LVL 1

Author Comment

by:HBS-Mach
ID: 41733797
Hi all
Thanks for the help.

@oBdA - A reboot does fix the time when ive reconfigured the syncfromflag.
Maybe its a group policy we have, but a reboot resets the time to the correct time
But, stopping the service also works.

@acbrown2010 - Thanks, w32tm /config /syncfromflags:no /update worked fine for me.

@kaffiend - thanks for pointing me in the right direction to look it up myself. Teach a man to fish etc...
0
 
LVL 1

Author Closing Comment

by:HBS-Mach
ID: 41733800
w32tm /config /syncfromflags:no /update

worked fine for me.
Check if the change is reverted back, otherwise the server will be changed forever.
0

Featured Post

Edgartown IT Case Study

Learn about Edgartown's quest to ensure the safety and security of the entire town's employee and citizen data. Read the case study!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Windows 10 Creator Update has just been released and I have it working very well on my laptop. Read below for issues, fixes and ideas.
In this post we will be converting StringData saved within a text file into a hash table. This can be further used in a PowerShell script for replacing settings that are dynamic in nature from environment to environment.
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

691 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question