How to Set the Date and Time in Windows Server Core 2012 R2
It is easy to set the time and date in Windows Server Core 2012 R2, despite the lack of a graphical user interface. In this Ask the Admin, we’ll cover two different methods to set date and time.
Maintaining the correct time and date on a server can be critical for certain operations such as Kerberos authentication in Active Directory (AD) domains. On domain member servers (with either the full GUI or Server Core) the time is automatically synchronized with the domain. Assuming the primary time server in your domain is set correctly, all domain members should maintain the correct time and date.
Time is synchronized in an Active Directory forest in a top-down hierarchical manner, starting with the domain controller that holds the Primary Domain Controller (PDC) role in the forest root domain. This domain controller is often set to synchronize with an external Internet-based time server. If the PDC in the forest root domain goes offline or malfunctions, time synchronization issues in your AD forest could result in log-on failures.
On a standalone server you might need to set the date and time manually. While no configuration is necessary for automatic time synchronization in a domain, it is possible to maintain the default time synchronization settings using Group Policy. What follows are directions for setting the date and time in Windows Server Core 2012 R2, but we also have separate instructions for setting the date and time in Windows Server Core 2008 as well.
Say Goodbye to Traditional PC Lifecycle Management
Traditional IT tools, including Microsoft SCCM, Ghost Solution Suite, and KACE, often require considerable custom configurations by T3 technicians (an expensive and often elusive IT resource) to enable management of a hybrid onsite + remote workforce. In many cases, even with the best resources, organizations are finding that these on-premise tools simply cannot support remote endpoints consistently and reliably due to infrastructure limitations.
Using the Server Core Configuration Tool
Microsoft includes a simple text-based configuration tool that system administrators can use to set up Server Core without having to remember PowerShell commands. So if you forget a particular command you can always launch sconfig.cmd.
- Log-on to Server Core 2012 R2 with an administrator account.
- In the command prompt window, type sconfig.cmd and press ENTER.
- At the prompt, select 9 to set the date and time and press ENTER.
- The Date and Time Control Panel applet will now appear and you can set the date, time, and time zone in the same way as in any other version of Windows.
- When you’re done click OK in the Control Panel applet to return to the Server Core configuration tool.
- To exit the tool and go back to the command line, select option 15 and press ENTER.
Setting the Time and Date with PowerShell
Alternately, it’s easy to set the time and date using PowerShell.
- Log-in to Windows Server Core 2012 R2 with administrative privileges.
- In the command prompt window type, powershell and press ENTER.
- Now type set-date -date “06/06/2014 18:53” and press ENTER, replacing the date and time in the string as required. The date and time as set by the command will now be displayed in the command prompt.
Remember that you must use numbers to specify the date, so you can’t type July 4th 2014. It is possible to specify the time like 6:53pm instead of using the 24-hour clock.
You can also just run the set-date cmdlet and press ENTER. You will then be prompted to enter the date and time in the same format as in the command shown above, but without the quotation marks.