Jump to content




anyweb

How can I sync the BIOS date in WinPE to avoid PXE boot failure with System Center 2012 R2 Configuration Manager ?



Recommended Posts

Introduction

I've seen this quite a bit so I thought I might as well post it in case others see the same problem, what happens is that computers (virtual or real) that have an incorrect date in the BIOS will cause Policy retrieval problems during PXE boot.

 

Problem

Failure to retrieve policy means you cannot run any task sequence and the failure will in turn produce an error just before running any Required (Mandatory) task sequence or before displaying a list of one or more Available (optional) task sequences.

 

Note: The error produced occurs immediately after entering the PXE password if one is set. The error message displayed to the end user is shown below, in the example below the DATE was set to one year earlier than the current date:

 

Failed to Run Task Sequence An error occurred while retrieving policy for this computer (0x80004005). For more information, please contact your system administrator or helpdesk operator.

 

 

Failed to Run Task Sequence.png

 

and the actual error message shown using CMTrace in red text in the SMSTS.LOG file found in x:\windows\temp\smstslog is shown below

 

reply has no message header marker.png

 

and the text of the error message contained in SMSTS.LOG will appear something like the below

 

<![LOG[reply has no message header marker]LOG]!><time="17:18:38.515+480" date="07-22-2013" component="TSPxe" context="" type="3" thread="1260" file="libsmsmessaging.cpp:1970">
<![LOG[DoRequest (sReply, true), HRESULT=80004005 (e:\qfe\nts\sms\framework\osdmessaging\libsmsmessaging.cpp,5868)]LOG]!><time="17:18:38.515+480" date="07-22-2013" component="TSPxe" context="" type="0" thread="1260" file="libsmsmessaging.cpp:5868">
<![LOG[Failed to get client identity (80004005)]LOG]!><time="17:18:38.530+480" date="07-22-2013" component="TSPxe" context="" type="3" thread="1260" file="libsmsmessaging.cpp:6148">
<![LOG[ClientIdentity.RequestClientIdentity (), HRESULT=80004005 (e:\qfe\nts\sms\client\tasksequence\tsmbootstrap\tsmediawizardcontrol.cpp,1114)]LOG]!><time="17:18:38.530+480" date="07-22-2013" component="TSPxe" context="" type="0" thread="1260" file="tsmediawizardcontrol.cpp:1114">
<![LOG[failed to request for client]LOG]!><time="17:18:38.530+480" date="07-22-2013" component="TSPxe" context="" type="3" thread="1260" file="tsmediawizardcontrol.cpp:1114">
<![LOG[Exiting TSMediaWizardControl::GetPolicy.]LOG]!><time="17:18:38.530+480" date="07-22-2013" component="TSPxe" context="" type="0" thread="1260" file="tsmediawizardcontrol.cpp:1420">

 

 

Solution

 

Well the fix is easy enough, simply set the correct date in the bios and then reboot the client computer and PXE boot again, this time it should not get the error noted above and it should receive policy correctly.

 

While the above is an easy fix if it's a rare event you might want to automate a solution if you deal with imaging a lot of computers. So here's a method I've created to do just that, it uses the prestart ability to run a script in WinPE to sync time using NET TIME with a server you specify in your domain, it does require domain user credentials but you can decide how to deal with that.

 

So Let's get started...

 

Step 1. Download the following script

 

WinPE_timesync.zip

 

Copy this script somewhere useful on your ConfigMgr server, once done open it in notepad and configure the following section before continuing,

 

configure this section.png

 

save your changes

 

Step 2. Add a prestart command to your boot wim

 

Locate a boot image that you are using in your Task Sequences, and right click it, choose properties.

 

properties.png

 

click on the Customization tab and place a checkmark in Enable Prestart Command as in the screenshot below, enter the following in the box provided

cscript.exe WinPE_TimeSync.vbs

cscript WinPE_TimeSync.png

 

Next, place a checkmark in the Include files for the prestart command and click on browse, then browse to the network share where the script downloaded above is stored as shown in the screenshot below

 

Include files for the prestart command.png

 

Apply the changes above, and answer yes when prompted as shown below

 

update dps now.png

 

Click next when prompted and continue through that wizard to completion.

 

close.png

 

Step 3. Test PXE boot

 

Using a computer that has the bios DATE deliberately set incorrectly (like 05-05-05) PXE boot the computer. If you only have access to a virtual machine such as hyperV then PXE boot and before entering the PXE password press F8, then type Date and enter the date 05-05-05.

 

Note: Please make sure that the last deployed task sequence contain the boot image used above otherwise this prestart won't be used. You can do this by right clicking on the last deployed task sequence and verify what boot image is listed in the Advanced tab like below.

 

boot image clean.png

 

Once done, PXE boot the computer with that you plan on testing with.

 

pxeboot.png

 

If it's a virtual machine like mine, press F8 and type date to set the date to something incorrect like 05-05-05 as shown below

 

current date is 05 05 05.png

 

Note: Without the prestart command and script provided here, the above date would be enough to produce the problem mentioned at the start of this guide !

 

Now you are ready to enter the PXE password, so go ahead and enter it, then press next, if you did the above correctly the prestart will pop up a command prompt window before running the script

 

prestart popping up.png

 

After a while, you'll see the list of task sequences displayed even though the computer had an incorrect BIOS date, now that is a result, no reboot needed !

 

list of task sequence.png

So how does it all work ? well the script makes a connection to the specified server using a domain user, once this completes successfully (and it's required), we use a NET TIME command to sync the bios DATE/TIME with that on the server specified. You can see this in action by reviewing the SMSTS.log in CMTRACE

 

In the screenshot below we see the first command prompt we opened to forcefully change the date manually.

 

Notice how the logging jumps from the real date/time to 2005, that's the incorrect date now in 'action'.

 

2005.png

 

scroll down a bit until you see it executing the prestart command as shown in the screenshot below, notice how before the prestart the date is 05-05-2005 but after it's changed to the correct date and that the date change correction occurs before the Management point is contacted

 

correct date set before get command.png

 

the rest of the smsts.log file will look like any normal one processing and downloading policy before displaying the list of task sequences, this would not be possible without the fix above.

 

download policy.png

 

job done !

 

Troubleshooting

 

The script generates three log files listed below

 

  • WinPE_TimeSync.log
  • WinPE_Net_Use.log
  • WinPE_Net_Time.log

 

please refer to these logs when troubleshooting non-working scenarios, for comparison purposes you can see what my successful log files look like below:

 

WinPE_TimeSync.log

 

WinPE_TimeSync log.png

 

WinPE_Net_Use.log

 

WinPE_Net_Use log.png

 

WinPE_Net_Time.log

 

WinPE_Net_Time log.png

 

Also to note, the script outputs the net use and net time commands to the CMD prompt window (for troubleshooting), but you can REM those lines out by changing any line that begins with:

wscript.echo strCommand

to

'wscript.echo strCommand

cheers

niall

 

Related Reading

 

You can download a Microsoft Word copy of this guide here.

 

How can I sync the BIOS date in WinPE to avoid PXE boot failure with System Center 2012 R2 Configuration Manager .zip

  • Like 1

Share this post


Link to post
Share on other sites


great, do let me know how it goes for you !

Share this post


Link to post
Share on other sites

Hi Niall,

This works a treat on my default boot image. I would like to add this to my MDT boot image I use in SCCM but already have a Prestart command. Someone suggest you can run multiple prestart commands by adding a '&' between them but when I run this command along with another yours doesn't run but the other command does. Have you ever used multiple prestart commands and what is the separator?

 

regards

 

Chiners_68

Share this post


Link to post
Share on other sites

i've tested multiple commands via a prestart such as

cmd.exe /c echo  192.168.0.1 p01.domain.lab.local >> x:\windows\system32\drivers\etc\hosts & cmd.exe /c echo  192.168.0.2 p02.domain.lab.local >> x:\windows\system32\drivers\etc\hosts

however in the guide above we are calling a script file using cscript.exe, how did you attempt to use the '&' symbol here ?

 

you could try a simple test such as below, I've verified it works just fine calling the scripts in the order provided.

cmd.exe /c cscript.exe prestart1.vbs & cscript.exe prestart2.vbs

Share this post


Link to post
Share on other sites

ok is it working then ?

Share this post


Link to post
Share on other sites

Didn't like the script in the root of the Prestart directory. it just ignored it and only run the ZTIMediaHook.wsf

put it in Deploy & Put the WinPE_TimeSync.vbs first, it started running that script but took a while & in the mean time the TS went to 8004005, Didn't get to prompt for Computer name from the ZTIMediaHook.wsf before the error which normally indicates date/time issue.

 

I've reversed the scripts to see if that works, ill grab the logs this time ;)

Share this post


Link to post
Share on other sites

if I enter the wsf file first that runs, but not the vbs. if I reverse them the vbs runs but not the wfs before it bombs.

wscript.exe Deploy\Scripts\ZTIMediaHook.wsf & cscript.exe Deploy\Scripts\WinPE_TimeSync.vbs

Share this post


Link to post
Share on other sites

so just run one of them and call the other script from within that one.

Dim objShell
Set objShell = Wscript.CreateObject("WScript.Shell")

objShell.Run "WinPe_TimeSync.vbs" 

' Using Set is mandatory
Set objShell = Nothing

Share this post


Link to post
Share on other sites

tried adding both ways but I have had issues. ill have to leave it for now as we've got 100 surface 3's to get out asap.

 

A couple of notes with surface 3's which may help others.

 

1. If your using the Official Dock or Gigabit Ethernet Adapter you need to import the Gigabit Ethernet driver into your boot.wim & driver packs. When importing it will add an x86 inf. If this gets imported into the boot.wim the devices will boot to just before the password box then just reboot. Remove this x86 driver & winpe boots successfully. Microsoft have not separated the x64 & x86 drivers in different folders.

 

2. to force power off you have to hold power & up on the volume button. If I recall the surface1/2 you just held the power off button. If the device is not shutdown correctly from windows it may not PXE boot (volume down & power on). In this case, force power of, switch on, wait till backlight on screen fires up the press power button once to switch off. Next time you Press for PXE it will work successfully.

 

3. Bitlocker encryption with recovery key in AD didn't work until I made the following mod. Had to set this reg key for it to function., Issue explained here http://netecm.netree.ch/blog/Lists/Posts/Post.aspx?ID=80

powershell.exe -command "New-Item -Path HKLM:\SOFTWARE\Policies\Microsoft -Name FVE; Set-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\FVE -Name OSEnablePrebootInputProtectorsOnSlates -Value 1 -Type DWord -Force" 

Share this post


Link to post
Share on other sites

have you seen my post about the Surface 3 here ? I did not see the behaviour you noticed for the nic drivers, and i covered that in detail in my post

 

I didn't see the bitlocker issue as I'm setting the registry keys as part of mbam client agent installation, however I will do up a post to cover it, thanks for the reminder

 

http://www.windows-noob.com/forums/index.php?/topic/11247-how-can-i-deploy-windows-81-x64-to-the-microsoft-surface-pro-3-using-system-center-2012-r2-configuration-manager

Share this post


Link to post
Share on other sites

Hi Niall- thank you for providing this write-up and the associated content. I've attempted to use this in my ConfigMgr 2012 R2 environment when doing PXE OSD however I've not had success. Strangely the script runs and the 3 logs created by the script all log success as well however I still receive the failed task sequence 0x80004005 error on the client. I thought I might try to increase the 5 second timeout some to see if this has any effect but wanted to reach out for comments and feedback here as well. Thanks in advance!

Share this post


Link to post
Share on other sites

hmm can you post the logs please, you can remove any domain senstive stuff from them first if you wish.

Share this post


Link to post
Share on other sites

Here you go. Thank you so much for the fast response and help on this and do let me know if you require more information from me. BTW- I'm not using PKI at all and my self-signed cert is still valid.

 

SMSTS.log contents:

 

LOGGING: Finalize process ID set to 832 TSBootShell 7/24/2014 6:00:07 PM 836 (0x0344)
==============================[ TSBootShell.exe ]============================== TSBootShell 7/24/2014 6:00:07 PM 836 (0x0344)
Succeeded loading resource DLL 'X:\sms\bin\x64\1033\TSRES.DLL' TSBootShell 7/24/2014 6:00:07 PM 836 (0x0344)
Debug shell is enabled TSBootShell 7/24/2014 6:00:07 PM 836 (0x0344)
Waiting for PNP initialization... TSBootShell 7/24/2014 6:00:07 PM 840 (0x0348)
RAM Disk Boot Path: NET(0)\SMSIMAGES\My-SiteCode00003\BOOT.My-SiteCode00003.WIM TSBootShell 7/24/2014 6:00:07 PM 840 (0x0348)
Booted from network (PXE) TSBootShell 7/24/2014 6:00:07 PM 840 (0x0348)
Network(PXE) path: X:\sms\data\ TSBootShell 7/24/2014 6:00:07 PM 840 (0x0348)
Found config path X:\sms\data\ TSBootShell 7/24/2014 6:00:07 PM 840 (0x0348)
This is not a fixed non usb disk TSBootShell 7/24/2014 6:00:07 PM 840 (0x0348)
Booting from removable media, not restoring bootloaders on hard drive TSBootShell 7/24/2014 6:00:07 PM 840 (0x0348)
X:\sms\data\WinPE does not exist. TSBootShell 7/24/2014 6:00:07 PM 840 (0x0348)
X:\_SmsTsWinPE\WinPE does not exist. TSBootShell 7/24/2014 6:00:07 PM 840 (0x0348)
Executing command line: wpeinit.exe -winpe TSBootShell 7/24/2014 6:00:07 PM 840 (0x0348)
The command completed successfully. TSBootShell 7/24/2014 6:00:20 PM 840 (0x0348)
Starting DNS client service. TSBootShell 7/24/2014 6:00:20 PM 840 (0x0348)
Executing command line: X:\sms\bin\x64\TsmBootstrap.exe /env:WinPE /configpath:X:\sms\data\ TSBootShell 7/24/2014 6:00:20 PM 840 (0x0348)
The command completed successfully. TSBootShell 7/24/2014 6:00:20 PM 840 (0x0348)
==============================[ TSMBootStrap.exe ]============================== TSMBootstrap 7/24/2014 6:00:20 PM 416 (0x01A0)
Command line: X:\sms\bin\x64\TsmBootstrap.exe /env:WinPE /configpath:X:\sms\data\ TSMBootstrap 7/24/2014 6:00:20 PM 416 (0x01A0)
Succeeded loading resource DLL 'X:\sms\bin\x64\1033\TSRES.DLL' TSMBootstrap 7/24/2014 6:00:20 PM 416 (0x01A0)
Succeeded loading resource DLL 'X:\sms\bin\x64\TSRESNLC.DLL' TSMBootstrap 7/24/2014 6:00:20 PM 416 (0x01A0)
Current OS version is 6.2.9200.0 TSMBootstrap 7/24/2014 6:00:20 PM 416 (0x01A0)
Adding SMS bin folder "X:\sms\bin\x64" to the system environment PATH TSMBootstrap 7/24/2014 6:00:20 PM 416 (0x01A0)
PXE Boot with Root = X:\ TSMBootstrap 7/24/2014 6:00:20 PM 416 (0x01A0)
Executing from PXE in WinPE TSMBootstrap 7/24/2014 6:00:20 PM 416 (0x01A0)
Loading TsPxe.dll from X:\sms\bin\x64\TsPxe.dll TSMBootstrap 7/24/2014 6:00:20 PM 416 (0x01A0)
TsPxe.dll loaded TSPxe 7/24/2014 6:00:20 PM 416 (0x01A0)
Device has PXE booted TSPxe 7/24/2014 6:00:20 PM 416 (0x01A0)
Variable Path: \SMSTemp\2014.09.25.13.22.04.0007.{C7C10772-19D7-4A67-949E-E0DB05230246}.boot.var TSPxe 7/24/2014 6:00:20 PM 416 (0x01A0)
Succesfully added firewall rule for Tftp TSPxe 7/24/2014 6:00:20 PM 416 (0x01A0)
Executing: X:\sms\bin\x64\smstftp.exe -i xxx.xxx.xxx.xxx get \SMSTemp\2014.09.25.13.22.04.0007.{C7C10772-19D7-4A67-949E-E0DB05230246}.boot.var X:\sms\data\variables.dat TSPxe 7/24/2014 6:00:20 PM 416 (0x01A0)
Command line for extension .exe is "%1" %* TSPxe 7/24/2014 6:00:20 PM 416 (0x01A0)
Set command line: "X:\sms\bin\x64\smstftp.exe" -i xxx.xxx.xxx.xxx get \SMSTemp\2014.09.25.13.22.04.0007.{C7C10772-19D7-4A67-949E-E0DB05230246}.boot.var X:\sms\data\variables.dat TSPxe 7/24/2014 6:00:20 PM 416 (0x01A0)
Executing command line: "X:\sms\bin\x64\smstftp.exe" -i xxx.xxx.xxx.xxx get \SMSTemp\2014.09.25.13.22.04.0007.{C7C10772-19D7-4A67-949E-E0DB05230246}.boot.var X:\sms\data\variables.dat TSPxe 7/24/2014 6:00:20 PM 416 (0x01A0)
Process completed with exit code 0 TSPxe 7/24/2014 6:00:21 PM 416 (0x01A0)
Succesfully removed firewall rule for Tftp TSPxe 7/24/2014 6:00:21 PM 416 (0x01A0)
Successfully downloaded pxe variable file. TSPxe 7/24/2014 6:00:21 PM 416 (0x01A0)
we are booted using PXE TSPxe 7/24/2014 6:00:21 PM 416 (0x01A0)
we are booted using PXE and we don't use a password or the password is provided by the user TSPxe 7/24/2014 6:00:21 PM 416 (0x01A0)
Found network adapter "LAN9512/LAN9514 USB 2.0 to Ethernet 10/100 Adapter" with IP Address xxx.xxx.xxx.xxx. TSPxe 7/24/2014 6:00:21 PM 416 (0x01A0)
Run PXE Interactive TSPxe 7/24/2014 6:00:21 PM 416 (0x01A0)
Running Wizard in Interactive mode TSPxe 7/24/2014 6:00:21 PM 416 (0x01A0)
Loading Media Variables from "X:\sms\data\variables.dat" TSPxe 7/24/2014 6:00:21 PM 416 (0x01A0)
CryptDecrypt (hKey, 0, 1, 0, pData, &dwDecryptedLen), HRESULT=80090005 (e:\qfe\nts\sms\framework\smscrypt\windes.cpp,165) TSPxe 7/24/2014 6:00:21 PM 416 (0x01A0)
SMS::Crypto::DES::DecryptBuffer( (BYTE*)pszPassword, (DWORD)(wcslen(pszPassword)*sizeof(WCHAR)), encryptedBuffer.getBuffer(), (DWORD)encryptedBuffer.size(), pbDecryptedBuffer, dwDecryptedBufferSize ), HRESULT=80090005 (e:\qfe\nts\sms\framework\tscore\tsremovablemedia.cpp,387) TSPxe 7/24/2014 6:00:21 PM 416 (0x01A0)
Activating Welcome Page. TSPxe 7/24/2014 6:00:21 PM 416 (0x01A0)
Loading bitmap TSPxe 7/24/2014 6:00:21 PM 416 (0x01A0)
WelcomePage::OnWizardNext() TSPxe 7/24/2014 6:00:27 PM 416 (0x01A0)
Loading Media Variables from "X:\sms\data\variables.dat" TSPxe 7/24/2014 6:00:27 PM 416 (0x01A0)
CryptDecrypt (hKey, 0, 1, 0, pData, &dwDecryptedLen), HRESULT=80090005 (e:\qfe\nts\sms\framework\smscrypt\windes.cpp,165) TSPxe 7/24/2014 6:00:27 PM 416 (0x01A0)
SMS::Crypto::DES::DecryptBuffer( (BYTE*)pszPassword, (DWORD)(wcslen(pszPassword)*sizeof(WCHAR)), encryptedBuffer.getBuffer(), (DWORD)encryptedBuffer.size(), pbDecryptedBuffer, dwDecryptedBufferSize ), HRESULT=80090005 (e:\qfe\nts\sms\framework\tscore\tsremovablemedia.cpp,387) TSPxe 7/24/2014 6:00:27 PM 416 (0x01A0)
Loading Media Variables from "X:\sms\data\variables.dat" TSPxe 7/24/2014 6:00:27 PM 416 (0x01A0)
CryptDecrypt (hKey, 0, 1, 0, pData, &dwDecryptedLen), HRESULT=80090005 (e:\qfe\nts\sms\framework\smscrypt\windes.cpp,165) TSPxe 7/24/2014 6:00:27 PM 416 (0x01A0)
SMS::Crypto::DES::DecryptBuffer( (BYTE*)pszPassword, (DWORD)(wcslen(pszPassword)*sizeof(WCHAR)), encryptedBuffer.getBuffer(), (DWORD)encryptedBuffer.size(), pbDecryptedBuffer, dwDecryptedBufferSize ), HRESULT=80090005 (e:\qfe\nts\sms\framework\tscore\tsremovablemedia.cpp,387) TSPxe 7/24/2014 6:00:27 PM 416 (0x01A0)
Verifying media password. TSPxe 7/24/2014 6:00:27 PM 416 (0x01A0)
Loading Media Variables from "X:\sms\data\variables.dat" TSPxe 7/24/2014 6:00:27 PM 416 (0x01A0)
Spawned thread 852 to download policy. TSPxe 7/24/2014 6:00:27 PM 416 (0x01A0)
Entering TSMediaWizardControl::GetPolicy. TSPxe 7/24/2014 6:00:27 PM 852 (0x0354)
Creating key 'Software\Microsoft\SMS\47006C006F00620061006C005C007B00350031004100300031003600420036002D0046003000440045002D0034003700350032002D0042003900370043002D003500340045003600460033003800360041003900310032007D00' TSPxe 7/24/2014 6:00:27 PM 852 (0x0354)
Environment scope successfully created: Global\{51A016B6-F0DE-4752-B97C-54E6F386A912} TSPxe 7/24/2014 6:00:27 PM 852 (0x0354)
Creating key 'Software\Microsoft\SMS\47006C006F00620061006C005C007B00420041003300410033003900300030002D0043004100360044002D0034006100630031002D0038004300320038002D003500300037003300410046004300320032004200300033007D00' TSPxe 7/24/2014 6:00:27 PM 852 (0x0354)
Environment scope successfully created: Global\{BA3A3900-CA6D-4ac1-8C28-5073AFC22B03} TSPxe 7/24/2014 6:00:27 PM 852 (0x0354)
Setting LogMaxSize to 1000000 TSPxe 7/24/2014 6:00:27 PM 852 (0x0354)
Setting LogMaxHistory to 1 TSPxe 7/24/2014 6:00:27 PM 852 (0x0354)
Setting LogLevel to 0 TSPxe 7/24/2014 6:00:27 PM 852 (0x0354)
Setting LogEnabled to 1 TSPxe 7/24/2014 6:00:27 PM 852 (0x0354)
Setting LogDebug to 1 TSPxe 7/24/2014 6:00:27 PM 852 (0x0354)
UEFI: true TSPxe 7/24/2014 6:00:27 PM 852 (0x0354)
Loading variables from the Task Sequencing Removable Media. TSPxe 7/24/2014 6:00:27 PM 852 (0x0354)
Loading Media Variables from "X:\sms\data\variables.dat" TSPxe 7/24/2014 6:00:27 PM 852 (0x0354)
Succeeded loading resource DLL 'X:\sms\bin\x64\1033\TSRES.DLL' TSPxe 7/24/2014 6:00:27 PM 852 (0x0354)
Setting SMSTSMP TS environment variable TSPxe 7/24/2014 6:00:27 PM 852 (0x0354)
Setting _SMSMediaGuid TS environment variable TSPxe 7/24/2014 6:00:27 PM 852 (0x0354)
Setting _SMSTSBootMediaPackageID TS environment variable TSPxe 7/24/2014 6:00:27 PM 852 (0x0354)
Setting _SMSTSHTTPPort TS environment variable TSPxe 7/24/2014 6:00:27 PM 852 (0x0354)
Setting _SMSTSHTTPSPort TS environment variable TSPxe 7/24/2014 6:00:27 PM 852 (0x0354)
Setting _SMSTSIISSSLState TS environment variable TSPxe 7/24/2014 6:00:27 PM 852 (0x0354)
Setting _SMSTSLaunchMode TS environment variable TSPxe 7/24/2014 6:00:27 PM 852 (0x0354)
Setting _SMSTSMediaPFX TS environment variable TSPxe 7/24/2014 6:00:27 PM 852 (0x0354)
Setting _SMSTSPublicRootKey TS environment variable TSPxe 7/24/2014 6:00:27 PM 852 (0x0354)
Setting _SMSTSSiteCode TS environment variable TSPxe 7/24/2014 6:00:27 PM 852 (0x0354)
Setting _SMSTSSiteSigningCertificate TS environment variable TSPxe 7/24/2014 6:00:27 PM 852 (0x0354)
Setting _SMSTSUseFirstCert TS environment variable TSPxe 7/24/2014 6:00:27 PM 852 (0x0354)
Setting _SMSTSx64UnknownMachineGUID TS environment variable TSPxe 7/24/2014 6:00:27 PM 852 (0x0354)
Setting _SMSTSx86UnknownMachineGUID TS environment variable TSPxe 7/24/2014 6:00:27 PM 852 (0x0354)
Root CA Public Certs= TSPxe 7/24/2014 6:00:27 PM 852 (0x0354)
Missing root CA environment variable from variables file TSPxe 7/24/2014 6:00:27 PM 852 (0x0354)
Support Unknown Machines: 0 TSPxe 7/24/2014 6:00:27 PM 852 (0x0354)
Custom hook from X:\\TSConfig.INI is cscript.exe WinPE_timesync_.vbs TSPxe 7/24/2014 6:00:27 PM 852 (0x0354)
Custom hook source is SMS10000 TSPxe 7/24/2014 6:00:27 PM 852 (0x0354)
Finding package: C:\SMS\PKG\SMS10000 TSPxe 7/24/2014 6:00:28 PM 852 (0x0354)
Finding package: D:\SMS\PKG\SMS10000 TSPxe 7/24/2014 6:00:28 PM 852 (0x0354)
Finding package: E:\SMS\PKG\SMS10000 TSPxe 7/24/2014 6:00:28 PM 852 (0x0354)
Finding package: X:\SMS\PKG\SMS10000 TSPxe 7/24/2014 6:00:28 PM 852 (0x0354)
FindPackageFolder found: X:\SMS\PKG\SMS10000 TSPxe 7/24/2014 6:00:28 PM 852 (0x0354)
Using path: X:\SMS\PKG\SMS10000 TSPxe 7/24/2014 6:00:28 PM 852 (0x0354)
Successfully registered Task Sequencing COM Interface. TSPxe 7/24/2014 6:00:28 PM 852 (0x0354)
Command line for extension .exe is "%1" %* TSPxe 7/24/2014 6:00:28 PM 852 (0x0354)
Set command line: cscript.exe WinPE_timesync_.vbs TSPxe 7/24/2014 6:00:28 PM 852 (0x0354)
Executing command line: cscript.exe WinPE_timesync_.vbs TSPxe 7/24/2014 6:00:28 PM 852 (0x0354)
Executing command line: X:\WINDOWS\system32\cmd.exe /k TSBootShell 7/24/2014 6:00:31 PM 836 (0x0344)
The command completed successfully. TSBootShell 7/24/2014 6:00:31 PM 836 (0x0344)
Successfully launched command shell. TSBootShell 7/24/2014 6:00:31 PM 836 (0x0344)
Process completed with exit code 0 TSPxe 7/24/2014 6:01:00 PM 852 (0x0354)
Succeeded loading resource DLL 'X:\sms\bin\x64\1033\TSRES.DLL' TSPxe 7/24/2014 6:01:00 PM 852 (0x0354)
Successfully unregistered Task Sequencing Environment COM Interface. TSPxe 7/24/2014 6:01:00 PM 852 (0x0354)
Authenticator from the environment is empty. TSPxe 7/24/2014 6:01:00 PM 852 (0x0354)
Need to create Authenticator Info using PFX TSPxe 7/24/2014 6:01:00 PM 852 (0x0354)
Initialized CStringStream object with string: d22caf5b-9681-4fad-9943-a115fdcbc76a;2014-07-25T02:01:00Z. TSPxe 7/24/2014 6:01:00 PM 852 (0x0354)
Set media certificate in transport TSPxe 7/24/2014 6:01:00 PM 852 (0x0354)
Set authenticator in transport TSPxe 7/24/2014 6:01:00 PM 852 (0x0354)
CLibSMSMessageWinHttpTransport::Send: URL: MyConfigMgr2012R2-FQDN:80 GET /SMS_MP/.sms_aut?MPKEYINFORMATIONMEDIA TSPxe 7/24/2014 6:01:00 PM 852 (0x0354)
Request was successful. TSPxe 7/24/2014 6:01:00 PM 852 (0x0354)
Default CSP is Microsoft Enhanced RSA and AES Cryptographic Provider TSPxe 7/24/2014 6:01:00 PM 852 (0x0354)
Default CSP Type is 24 TSPxe 7/24/2014 6:01:00 PM 852 (0x0354)
New settings: TSPxe 7/24/2014 6:01:00 PM 852 (0x0354)
site=My-SiteCode,My-SiteCode, MP=http://MyConfigMgr2012R2-FQDN, ports: http=80,https=443 TSPxe 7/24/2014 6:01:00 PM 852 (0x0354)
certificates are received from MP. TSPxe 7/24/2014 6:01:00 PM 852 (0x0354)
Unknown machine GUIDs: ee25c72b-934d-4008-a952-d1217ec70954 7a9dfbae-3783-4769-851c-3d60d84775c1 TSPxe 7/24/2014 6:01:00 PM 852 (0x0354)
Getting MP time information TSPxe 7/24/2014 6:01:00 PM 852 (0x0354)
Set authenticator in transport TSPxe 7/24/2014 6:01:00 PM 852 (0x0354)
Requesting client identity TSPxe 7/24/2014 6:01:00 PM 852 (0x0354)
Setting message signatures. TSPxe 7/24/2014 6:01:00 PM 852 (0x0354)
Setting the authenticator. TSPxe 7/24/2014 6:01:00 PM 852 (0x0354)
CLibSMSMessageWinHttpTransport::Send: URL: MyConfigMgr2012R2-FQDN:80 CCM_POST /ccm_system/request TSPxe 7/24/2014 6:01:01 PM 852 (0x0354)
Request was successful. TSPxe 7/24/2014 6:01:01 PM 852 (0x0354)
pNext != NULL, HRESULT=80004005 (e:\qfe\nts\sms\framework\osdmessaging\libsmsmessaging.cpp,1970) TSPxe 7/24/2014 6:01:01 PM 852 (0x0354)
reply has no message header marker TSPxe 7/24/2014 6:01:01 PM 852 (0x0354)
DoRequest (sReply, true), HRESULT=80004005 (e:\qfe\nts\sms\framework\osdmessaging\libsmsmessaging.cpp,5868) TSPxe 7/24/2014 6:01:01 PM 852 (0x0354)
Failed to get client identity (80004005) TSPxe 7/24/2014 6:01:01 PM 852 (0x0354)
ClientIdentity.RequestClientIdentity (), HRESULT=80004005 (e:\qfe\nts\sms\client\tasksequence\tsmbootstrap\tsmediawizardcontrol.cpp,1114) TSPxe 7/24/2014 6:01:01 PM 852 (0x0354)
failed to request for client TSPxe 7/24/2014 6:01:01 PM 852 (0x0354)
Exiting TSMediaWizardControl::GetPolicy. TSPxe 7/24/2014 6:01:01 PM 852 (0x0354)
pWelcomePage->m_pTSMediaWizardControl->GetPolicy(), HRESULT=80004005 (e:\qfe\nts\sms\client\tasksequence\tsmbootstrap\tsmediawelcomepage.cpp,303) TSPxe 7/24/2014 6:01:01 PM 852 (0x0354)
Setting wizard error: An error occurred while retrieving policy for this computer (0x80004005). For more information, contact your system administrator or helpdesk operator. TSPxe 7/24/2014 6:01:01 PM 416 (0x01A0)
WelcomePage::OnWizardNext() TSPxe 7/24/2014 6:01:01 PM 416 (0x01A0)
Skipping Confirmation Page. TSPxe 7/24/2014 6:01:01 PM 416 (0x01A0)
Skipping Task Sequence Selection Page. TSPxe 7/24/2014 6:01:01 PM 416 (0x01A0)
Skipping Variables Selection Page. TSPxe 7/24/2014 6:01:01 PM 416 (0x01A0)
Skipping Resolve Progress Page. TSPxe 7/24/2014 6:01:01 PM 416 (0x01A0)
Activating Finish Page. TSPxe 7/24/2014 6:01:01 PM 416 (0x01A0)
Initializing the countdown timer. TSPxe 7/24/2014 6:01:01 PM 416 (0x01A0)
Loading bitmap TSPxe 7/24/2014 6:01:01 PM 416 (0x01A0)
Exiting task sequence wizard. TSPxe 7/24/2014 6:01:16 PM 416 (0x01A0)
Exiting with return code 0x00000000 TSPxe 7/24/2014 6:01:16 PM 416 (0x01A0)
Execution complete. TSBootShell 7/24/2014 6:01:16 PM 840 (0x0348)
hMap != 0, HRESULT=80070002 (e:\qfe\nts\sms\framework\tscore\environmentscope.cpp,493) TSBootShell 7/24/2014 6:01:16 PM 840 (0x0348)
m_pGlobalScope->open(), HRESULT=80070002 (e:\qfe\nts\sms\framework\tscore\environmentlib.cpp,335) TSBootShell 7/24/2014 6:01:16 PM 840 (0x0348)
this->open(), HRESULT=80070002 (e:\qfe\nts\sms\framework\tscore\environmentlib.cpp,553) TSBootShell 7/24/2014 6:01:16 PM 840 (0x0348)
::RegOpenKeyExW (HKEY_LOCAL_MACHINE, sKey.c_str(), 0, KEY_READ, &hSubKey), HRESULT=80070002 (e:\qfe\nts\sms\framework\tscore\utils.cpp,809) TSBootShell 7/24/2014 6:01:16 PM 840 (0x0348)
RegOpenKeyExW is unsuccessful for Software\Microsoft\SMS\Task Sequence TSBootShell 7/24/2014 6:01:16 PM 840 (0x0348)
GetTsRegValue() is unsuccessful. 0x80070002. TSBootShell 7/24/2014 6:01:16 PM 840 (0x0348)
End program: TSBootShell 7/24/2014 6:01:16 PM 840 (0x0348)
Finalizing logging from process 832 TSBootShell 7/24/2014 6:01:16 PM 840 (0x0348)
Finalizing logs to root of first available drive TSBootShell 7/24/2014 6:01:16 PM 840 (0x0348)
LOGGING: Setting log directory to "C:\SMSTSLog". TSBootShell 7/24/2014 6:01:16 PM 840 (0x0348)

 

WinPE_net_use.log:

 

The command completed successfully.

 

 

WinPE_TimeSync.log:

 

##############################################
WinPE Time sync Script
##############################################
7/24/2014 6:00:28 PM Starting logging process.
7/24/2014 6:00:28 PM sleeping for 15 seconds..
7/24/2014 6:00:43 PM Using NET USE to Connect to ConfigMgr-2012R2-Server as a Domain user..
7/24/2014 6:00:45 PM ...NET USE connected ok, continuing.
7/24/2014 6:00:45 PM Using the NET TIME command to sync with the Server time..
7/24/2014 6:00:45 PM Waiting for 15 seconds so the new time is registered before talking to the mp..
7/24/2014 6:01:00 PM all done, exiting..

Share this post


Link to post
Share on other sites

well i think your problem is because the script isnt running at the right time (i.e. it's not running as a prestart command), i dont see it being mentioned in the smsts.log file at all (look at my screenshots where it says it's executing the script), then look at your smsts.log, do you see the prestart starting ?

 

also, your other logs are of a different time, so you probably generated them when manually testing the script.

Share this post


Link to post
Share on other sites

Niall my appologies; I actually copied the contents of the wrong smsts.log in my posted reply. I've edited my post with the correct log and you'll now see the script in action and the log time/date stamps now match.

Share this post


Link to post
Share on other sites

hmm interesting,

if you manually run the net use commands shown by the strcommand in a command prompt in winpe, what happens ?

 

is anything in your winpe_net_time.log ?

Share this post


Link to post
Share on other sites

Wanted to follow up with an update; I now have this working. In our org we have PXE traffic isolated and I found that the 'net time' step was failing. Based on the failure I had to modify the syntax of the script as shown below to simply use our ConfigMgr server as the source for the time sync.

 

strUser = "username"
strPassword = "password"
strDomain = "domain.name"
strServer = "MyConfigMgrServer"

 

strCommand = ("cmd /c net time \\") & strServer & (" /SET /Y") & (">") & (" ") & ("x:\WinPE_net_time.log")

 

Niall - I simply cannot thank you enough for this post and for your generous help in this matter.

  • Like 1

Share this post


Link to post
Share on other sites

I'm glad you figured it out and thanks for the update !

Share this post


Link to post
Share on other sites

hi Mikey

i just tested it here, worked fine, which file are you failing to download (link please)

Share this post


Link to post
Share on other sites

hi Mikey

i just tested it here, worked fine, which file are you failing to download (link please)

 

Cheers Niall, it is working fine now, strange.

 

Thanks for responding.

 

 

FYI It was this one:

 

Step 1. Download the following script

zip.gif WinPE_timesync.zip 1.49KB 185 downloads

Share this post


Link to post
Share on other sites

actually, while i am here - Will machines get policies if their time is inaccurate but date correct?

 

Is being out by x number of hours OK, and if so, what does x equal?

 

AD/GP is 4 hours by default isnt it? Or is it 1?

 

Thank you

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×