ProLiant Deployment and Provisioning
1839310 Members
2749 Online
110138 Solutions
New Discussion

RDP - Setting initial date & time on ProLiants (probably work with others...)

 
SysAdminGuy
Advisor

RDP - Setting initial date & time on ProLiants (probably work with others...)

Not a question, but spent loads of time figuring it out so sharing the love!
Using ALtiris RDP to provision new servers, I use logging extensively, a lot of which date/time stamps actions that are taken. It's not unusual for the date & time to be a fair way out if the boxes have been sitting in a store room for months.
A second problem (for windows at least) is if the BIOS date/time stamp is out by too much, when the server is joined to a domain or Windows Time is configured to sync with any other time source (e.g. NTP), it will fail to sync.
To get accurate time stamping in logs, and resolve the time sync issue, the very first job I now run is an RDP task that uses Altiris tokens in a WinPE boot environment to 'initialise' the date & time which works a treat. The WLogEvent lines print output to the status detail of the job so you've also got a documented result of what it's done:
**********
REM Sync initial date and time to RDP server
WLogevent -c:0 -l:1 -ss:"Date will be set to: %DATE%"
date %DATE%
WLogevent -c:0 -l:1 -ss:"Time will be set to: %TIME%"
time %TIME%
**********