Solved

Disable Time Sync on Windows server on Domain

Posted on 2016-07-27
8
73 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
Portable, direct connect server access

The ATEN CV211 connects a laptop directly to any server allowing you instant access to perform data maintenance and local operations, for quick troubleshooting, updating, service and repair.

 
LVL 40

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 84

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article describes my battle tested process for setting up delegation. I use this process anywhere that I need to setup delegation. In the article I will show how it applies to Active Directory
The Windows functions GetTickCount and timeGetTime retrieve the number of milliseconds since the system was started. However, the value is stored in a DWORD, which means that it wraps around to zero every 49.7 days. This article shows how to solve t…
The viewer will learn how to successfully create a multiboot device using the SARDU utility on Windows 7. Start the SARDU utility: Change the image directory to wherever you store your ISOs, this will prevent you from having 2 copies of an ISO wit…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

749 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