?
Solved

Disable Time Sync on Windows server on Domain

Posted on 2016-07-27
8
Medium Priority
?
99 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 800 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
Creating Active Directory Users from a Text File

If your organization has a need to mass-create AD user accounts, watch this video to see how its done without the need for scripting or other unnecessary complexities.

 
LVL 43

Accepted Solution

by:
Adam Brown earned 1000 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 200 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

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

How to deal with a specific error when using the Enable-RemoteMailbox cmdlet to create a mailbox in the cloud-based service, for an existing user in an on-premises Active Directory.
It’s time for spooky stories and consuming way too much sugar, including the many treats we’ve whipped for you in the world of tech. Check it out!
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…

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