FriendsOfMDT / PSD

PowerShell Deployment
MIT License
526 stars 83 forks source link

BUG: Problems with USB Network Adapter on step "Checking for a valid network configuration" #124

Open Tenster opened 10 months ago

Tenster commented 10 months ago

I have an issue where systems using a USB network adapter simply stop at this step.

In the powershell prompt, it's evident that there is a DHCP timeout. Once a release and renew are performed, the script continues after starting it again.

To address this problem, I added the following line in the PSDStart.ps1 file:

# Check Network
            Write-PSDBootInfo -SleepSec 1 -Message "Checking for a valid network configuration"
            Write-PSDLog -Message "$($MyInvocation.MyCommand.Name): Invoking DHCP refresh..."    
                        $Null = Invoke-PSDexe -Executable ipconfig.exe -Arguments "/release"
            $Null = Invoke-PSDexe -Executable ipconfig.exe -Arguments "/renew"
GeoSimos commented 10 months ago

From what you described, have you seen if the usb network adapter is not ready at the time the dhcp request is initiated?

Tenster commented 10 months ago

Good point, I will look into it again. What I find strange is that it already gets an IP before it even starts the job of checking the connection and trying to establish one.

GeoSimos commented 10 months ago

Well the WinPE boot image is created as it does via MDT, nothing sketchy there, standard WinPE boot image.

Tenster commented 10 months ago

Sorry for any confusion in my previous message and the late reply.

Upon observing the setup, I noticed that the IP address field begins empty and is filled during the gather step before the actual network check begins.

Upon further investigation, I found no indications that the USB adapter wasn't ready.

The PSD logs abruptly end with it attempting to access the IIs, suggesting the network check step has completed successfully, though it hasn't.

This becomes apparent only upon manually invoking PSDStart again. An error is displayed during the execution of the "ipconfig /renew" task during the Network Check, showing that the DHCP request timed out.

I would be surprised if this issue is related to WinPE.

GeoSimos commented 10 months ago

What you can do to troubleshoot further, is to run the PSDHelper.ps1 script in your WinPE session and use the commandlets to check parts of the solution. After running the script, you will have the following PoSh modules imported:

  1. Microsoft.BDD.TaskSequenceModule (MDT Task Sequence module)
  2. PSDUtility
  3. PSDDeploymentShare
  4. PSDGather By running "Get-Command - Module ModuleName (names are in the list) you will see the commandlets available. Play a bit with them to reproduce the issue and report back when done. As far as I remember, if the NIC doesn't have a valid IP configuration, the solution is not moving further to the PSDWizard.

Another handy script you can use is PSDPrestart.ps1 which is under X:\Deploy\Prestart in WinPE mode, I suggest that you check it out as it is customizable and as is, it contains some handy functions. That one you can check it first, before the PSDHelper.ps1. Please view the code and it's references as it will give you a good idea how it works.

GeoSimos commented 9 months ago

Hi @Tenster, any progress to report?

Tenster commented 9 months ago

Hello, please excuse my delay in replying. I was unfortunately working on several other projects and didn't get to test. I'll try to test it in the coming weeks as I have to remove my customizations that make it work now.

DeploymentBunny commented 9 months ago

We are in the process of adding a better validation module in total, that will solve this is issue long term