MSEndpointMgr / ConfigMgr

Microsoft Endpoint Configuration Manager scripts and tools
633 stars 282 forks source link

ConfigMgr WebService, Invoke-CMApplyDriverPackage.ps1 not start in TS on Client #188

Closed StefanSa closed 4 years ago

StefanSa commented 4 years ago

Hi there, First of all, thank you for SCConfigMGR. I try to implement "Modern Driver Management", but the client only downloads the "Invoke-CMApplyDriverPackage.ps1" script, but does not start it.

2019-10-01 14:03:06 172.16.34.29 GET /SMS_DP_SMSPKG$/SER000B6/sccm /Invoke-CMApplyDriverPackage.ps1 80 - 172.16.33.151 SMS+CCM+5.0+TS - 200 0 0 68102 14 2019-10-01 14:03:06 172.16.34.29 GET /SMS_DP_SMSPKG$/SER000B6/sccm /Invoke-CMApplyDriverPackage.ps1 80 - 172.16.33.151 SMS+CCM+5.0+TS - 206 0 0 68151 0

Why does not the script start on the client? Thanks for any help

StefanSa commented 4 years ago

i found this in the smsts logfile: Executing command line: Run PowerShell Script with options (0, 4) Process completed with exit code 1 PowerShell command line returned code 1 Failed to run the action: Dynamically Apply Drivers. Error 1

chaosisbliss commented 4 years ago

You're having web service connection issues. There is a connection test within the tool that allows you to provide the url and key. It should return code 200.

https://yourserver .f.q.d.n.goesHere/ConfigMgrWebService/ConfigMgr.asmx

Error Code 1 = Unable to establish a connection to ConfigMgr WebService

StefanSa commented 4 years ago

That is very interesting. With F8 in OSD a ping on the SCCM SV work without problem. It must be a general problem in the OSD task. Have also tried via comandline task to execute the script, but with the same success.

powershell.exe -NoProfile -executionpolicy bypass -file Invoke-CMApplyDriverPackage.ps1 -URI "https://SCCM-Server/ConfigMgrWebService/ConfigMgr.asmx" -SecretKey "b3ad1b28-3454-4a34-b221-84200fd3055d" -Filter "Drivers" -DeploymentType BareMetal

Any idea what goes wrong here?

chaosisbliss commented 4 years ago

Yeah. Your using the wrong server in your url. It should have your server name in there.

StefanSa commented 4 years ago

Hmm, i actually do. This SCCM SV Name https://SCCM-Server is just one example. If i enter the correct name here (previously tested with ping) either as FQND or IP, i have no success. Do i overlook something there?

chaosisbliss commented 4 years ago

Haha. My fault. You should be able to take the url and put it in a browser. Just up to the .asmx in the url.

StefanSa commented 4 years ago

That's working. OSD

chaosisbliss commented 4 years ago

Awesome. Can you send a screenshot of your task sequence so I can see the setup?

StefanSa commented 4 years ago

OK, Task via CMD: TASK_PS_CMD

and Task native PS: TASK_PS

and Boot-Image Options: BootImage_Option

chaosisbliss commented 4 years ago

I'll be in the office in about 30 minutes and will look it over.

StefanSa commented 4 years ago

OK, thanks fine

chaosisbliss commented 4 years ago

You did download all the drivers and BIOS with the tool?

StefanSa commented 4 years ago

No, i want to try it. This is the first attempt with this tool (ConfigMgr-Webservice).

chaosisbliss commented 4 years ago

Ok. The one thing I do differently is I call the driver package through command line which then calls powershell. You might run into an issue where the powershell tries to run in 64bit but the task sequence, in the beginning, uses 32 bit.

So create a command line task sequence and put your code in the command line as shown below. Check the "Disable 64-bit file system redirection"

%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -WindowStyle Hidden -ExecutionPolicy Bypass -File Invoke-CMApplyDriverPackage.ps1 -URI "http://fakenameserver/ConfigMgrWebService/ConfigMgr.asmx" -SecretKey "fake key goes here" -Filter "Drivers" -DeploymentType DriverUpdate

Secondly, you have to download the drivers/bios through the driver automation tool. The comands below do not download the drivers/bios from the manufacturer. It downloads the packages you create with the Driver Automation Tool. Just download that, extract it and run the DriverAutomationToolSetup.exe within the folder. https://gallery.technet.microsoft.com/Driver-Tool-Automate-9ddcc010

StefanSa commented 4 years ago

sig the same: OSD_CMD

chaosisbliss commented 4 years ago

That looks good. Did you download and install the tool in the link I provided? It should look like this after installed. You do have to set it up once installed.

image

StefanSa commented 4 years ago

yes i have, you can also see the driver package via "GetCMPackage" GetCMPackage

For some reason, the script can not connect to the server. In the logfile of the IIS one sees no connection attempts.

StefanSa commented 4 years ago

Any other idea?

chaosisbliss commented 4 years ago

Can you change the -Deployment Type from BareMetal to DriverUpdate and test again?

"Drivers" -DeploymentType DriverUpdate

StefanSa commented 4 years ago

No the same, there is probably a general problem with the communication between Script and SCCM server. Is there a way to debug in OSD or to manually start the script in the OSD? If yes how ?

StefanSa commented 4 years ago

Hi, I found the mistake, banal as always when you know it. With OSD at least for us no "https" will works, but "http".

chaosisbliss commented 4 years ago

I've looked over your commands multiple times and missed that one. Good catch.