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
Solved

Disable Time Sync on Windows server on Domain

Posted on 2016-07-27
8
67 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
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
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 
LVL 39

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: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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

Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
How to record audio from input sources to your PC – connected devices, connected preamp to record vinyl discs, streaming media, that play through your audio card: Vista, Windows 7, Windows 8, Windows 8.1 and Windows 10 – both 32 bit & 64.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.
The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…

809 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