MSEndpointMgr / ConfigMgr

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

Invoke-CMApplyDriverPackage.ps1 : Error: 0000000A #191

Closed ecolint closed 4 years ago

ecolint commented 4 years ago

Hi,

I use Invoke-CMApplyDriverPackage.ps1 version 2.2.4 for Lenovo devices. I run the script through a task sequence in Software Center on a running Windows 10 version 1809.

The TS just contain one step that run the powershell script. But on client I get the error:

Failed to run the action: Dynamically Apply Drivers. The environment is incorrect. (Error: 0000000A; Source: Windows)

In detail, this is the SCCM step:

2019-10-07 16-28-25_10 1 1 27 - Remote Desktop Connection

The parameters is as follows: -URI "http://xxxxx/ConfigMgrWebService/ConfigMgr.asmx" -SecretKey "xxxxxx" -Filter "Drivers" -DeploymentType DriverUpdate

I tried just with -Filter "Drivers" and with -Filter "Drivers" -DeploymentType OSUpgrade without success, all my tests failed.

Any idea?

chaosisbliss commented 4 years ago

you need to call powershell through command prompt ts and disable 64 bit redirection.

ecolint commented 4 years ago

Hi,

Thanks for the answer.

Your solution works, thanks a lot, I don't have error now. But... the process is running and never finish:

2019-10-08 12-50-19_Window

How can I debug that, do you have an idea why the process is stuck?

ecolint commented 4 years ago

Hi, I still have the error:

Failed to run the action: Dynamically Apply Drivers. The environment is incorrect. (Error: 0000000A; Source: Windows)

Content successfully downloaded at C:_SMSTaskSequence\Packages\EIG0029C. InstallSoftware 17/10/2019 13:18:29 2740 (0x0AB4) Resolved source to 'C:_SMSTaskSequence\Packages\EIG0029C' InstallSoftware 17/10/2019 13:18:29 2740 (0x0AB4) Set command line: Run command line InstallSoftware 17/10/2019 13:18:29 2740 (0x0AB4) Working dir 'C:_SMSTaskSequence\Packages\EIG0029C' InstallSoftware 17/10/2019 13:18:29 2740 (0x0AB4) Executing command line: Run command line with options (16, 4) InstallSoftware 17/10/2019 13:18:29 2740 (0x0AB4) Process completed with exit code 10 InstallSoftware 17/10/2019 13:18:31 2740 (0x0AB4) Command line is being logged ('OSDDoNotLogCommand' is not set to 'True') InstallSoftware 17/10/2019 13:18:31 2740 (0x0AB4) Command line PowerShell -NoProfile -ExecutionPolicy Bypass -File Invoke-CMApplyDriverPackage-v2.2.3.ps1 -URI "http://xxxxxx.org/ConfigMgrWebService/ConfigMgr.asmx" -SecretKey "xxxxx" -Filter "Drivers" -DeploymentType DriverUpdate returned 10 InstallSoftware 17/10/2019 13:18:31 2740 (0x0AB4) ReleaseSource() for C:_SMSTaskSequence\Packages\EIG0029C. InstallSoftware 17/10/2019 13:18:31 2740 (0x0AB4) reference count 1 for the source C:_SMSTaskSequence\Packages\EIG0029C before releasing InstallSoftware 17/10/2019 13:18:31 2740 (0x0AB4) Released the resolved source C:_SMSTaskSequence\Packages\EIG0029C InstallSoftware 17/10/2019 13:18:31 2740 (0x0AB4) Process completed with exit code 10 TSManager 17/10/2019 13:18:31 10296 (0x2838) !--------------------------------------------------------------------------------------------! TSManager 17/10/2019 13:18:31 10296 (0x2838) Failed to run the action: Dynamically Apply Drivers. The environment is incorrect. (Error: 0000000A; Source: Windows) TSManager 17/10/2019 13:18:31 10296 (0x2838) Not in SSL TSManager 17/10/2019 13:18:31 10296 (0x2838) Set a global environment variable _SMSTSLastActionRetCode=10 TSManager 17/10/2019 13:18:31 10296 (0x2838) Set a global environment variable _SMSTSLastActionName=Dynamically Apply Drivers TSManager 17/10/2019 13:18:31 10296 (0x2838) Set a global environment variable _SMSTSLastActionSucceeded=false TSManager 17/10/2019 13:18:31 10296 (0x2838) Clear local default environment TSManager 17/10/2019 13:18:31 10296 (0x2838) Let the parent group (Modern Driver Management) decides whether to continue execution TSManager 17/10/2019 13:18:31 10296 (0x2838) The execution of the group (Modern Driver Management) has failed and the execution has been aborted. An action failed. Operation aborted (Error: 80004004; Source: Windows) TSManager 17/10/2019 13:18:31 10296 (0x2838) Failed to run the last action: Dynamically Apply Drivers. Execution of task sequence failed. The environment is incorrect. (Error: 0000000A; Source: Windows) TSManager 17/10/2019 13:18:31 10296 (0x2838) Not in SSL TSManager 17/10/2019 13:18:31 10296 (0x2838)

chaosisbliss commented 4 years ago

Are you running this on a VM? I see you're still calling powershell through command line which is good.

ecolint commented 4 years ago

It's not a VM, just a classic laptop with Windows 10 Enterprise, 1809. The other script for updating the BIOS "Invoke-CMDownloadBIOSPackage.ps1" works.

chaosisbliss commented 4 years ago

Can I see your run command line ts calling powershell?

ecolint commented 4 years ago

Hi,

Please find below:

PowerShell -NoProfile -ExecutionPolicy Bypass -File Invoke-CMApplyDriverPackage.ps1 -URI " http://SERVERNAME_FQDN/ConfigMgrWebService/ConfigMgr.asmx" -SecretKey "xxxxxx-xxxx-xxxx-xxxx-xxxxxxx" -Filter "Drivers" -DeploymentType DriverUpdate

Kind regards,

ecolint commented 4 years ago

Hi,

I found in the ApplyDriverPackage.log:

===== SCConfigMgr Invoke-CMApplyDriverPackage Version 2.2.3 ==== ApplyDriverPackage 21/10/2019 10:28:03 12988 (0x32BC) Driver download package process initiated ApplyDriverPackage 21/10/2019 10:28:03 12988 (0x32BC) Manufacturer determined as: Lenovo ApplyDriverPackage 21/10/2019 10:28:03 12988 (0x32BC) Computer model determined as: ThinkPad T470s ApplyDriverPackage 21/10/2019 10:28:03 12988 (0x32BC) Computer SKU determined as: 20HG ApplyDriverPackage 21/10/2019 10:28:03 12988 (0x32BC) Retrieved a total of 0 driver packages from web service ApplyDriverPackage 21/10/2019 10:28:06 12988 (0x32BC) Translated OSName from OSImageVersion: Windows 10 ApplyDriverPackage 21/10/2019 10:28:06 12988 (0x32BC) Translated OSVersion from OSImageVersion: 1809 ApplyDriverPackage 21/10/2019 10:28:06 12988 (0x32BC) Translated OSImageArchitecture: x64 ApplyDriverPackage 21/10/2019 10:28:06 12988 (0x32BC) No packages found. Please populate the driver repository ApplyDriverPackage 21/10/2019 10:28:06 12988 (0x32BC)

"Retrieved a total of 0 driver packages from web service."

This is weird as I have a package in SCCM called "Drivers - Lenovo ThinkPad T470s - Windows 10 x64" for my machine.

The same happened with ApplyBIOSPackage: "Retrieved a total of 0 BIOS packages from web service".

Do you know why it found 0 package?

ecolint commented 4 years ago

Problem solved: changed Identity of ConfigMgrWebService.

chaosisbliss commented 4 years ago

care to elaborate?

ecolint commented 4 years ago

Sorry I didn't catch that. What do you mean?

On Mon, 21 Oct 2019 at 13:21, chaosisbliss notifications@github.com wrote:

care to elaborate?

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/SCConfigMgr/ConfigMgr/issues/191?email_source=notifications&email_token=AC4TA4MQCT5D3KL6VFF3A3LQPWGC5A5CNFSM4I6FLUQ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBZ7HSY#issuecomment-544469963, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC4TA4JE5TVGX5FHEUR7P2TQPWGC5ANCNFSM4I6FLUQQ .

--

Josué Mouco

ICT Network Administrator

*International* School of Geneva

62, route de Chêne

CH-1208 Genève

Tel. +41 (0)22 787 24 42

Tel. +41 (0)79 626 97 21

http://www.ecolint.ch

The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer.

chaosisbliss commented 4 years ago

What do you mean you changed the identity?

ecolint commented 4 years ago

As follows: [image: image.png]

On Mon, 21 Oct 2019 at 13:56, chaosisbliss notifications@github.com wrote:

What do you mean you changed the identity?

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/SCConfigMgr/ConfigMgr/issues/191?email_source=notifications&email_token=AC4TA4JJVE4S3TBSWMUIGWDQPWKIDA5CNFSM4I6FLUQ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEB2B5II#issuecomment-544480929, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC4TA4IBTAPQEGI7BQ6UDPDQPWKIDANCNFSM4I6FLUQQ .

--

Josué Mouco

ICT Network Administrator

*International* School of Geneva

62, route de Chêne

CH-1208 Genève

Tel. +41 (0)22 787 24 42

Tel. +41 (0)79 626 97 21

http://www.ecolint.ch

The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer.

chaosisbliss commented 4 years ago

The image didn't post.

ecolint commented 4 years ago

the path is: IIS > Application Pools > ConfigMgrWebService > Advanced Settings > Identity > LocalSystem.

This seems not be documented and maybe should because I lost month to debug the problem.

On Mon, 21 Oct 2019 at 14:12, chaosisbliss notifications@github.com wrote:

The image didn't post.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/SCConfigMgr/ConfigMgr/issues/191?email_source=notifications&email_token=AC4TA4NUVX6HCNOAQ4P3YB3QPWMDHA5CNFSM4I6FLUQ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEB2DF6Q#issuecomment-544486138, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC4TA4IAUYA2HGRGEGEF53LQPWMDHANCNFSM4I6FLUQQ .

--

Josué Mouco

ICT Network Administrator

*International* School of Geneva

62, route de Chêne

CH-1208 Genève

Tel. +41 (0)22 787 24 42

Tel. +41 (0)79 626 97 21

http://www.ecolint.ch

The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer.

chaosisbliss commented 4 years ago

Ah. Yeah. I believe that is a step in the documentation to provide an account that has rights. Good catch. Glad it is working.