Skip to content
This repository was archived by the owner on Nov 16, 2023. It is now read-only.

Problems with ShellLauncherBridgeWmiHelpers.ps1 #489

Open
forderud opened this issue May 5, 2022 · 0 comments · May be fixed by #490
Open

Problems with ShellLauncherBridgeWmiHelpers.ps1 #489

forderud opened this issue May 5, 2022 · 0 comments · May be fixed by #490

Comments

@forderud
Copy link

forderud commented May 5, 2022

I'm experiencing problems configuring Shell Launcher V2 custom shell using the ShellLauncherBridgeWmiHelpers.ps1 script as documented on https://github.com/microsoft/Windows-iotcore-samples/tree/develop/Samples/ShellLauncherV2/SampleBridgeWmiScripts

Here's the error I'm observing in PowerShell (running as admin):

PS C:\Staging> . .\ShellLauncherBridgeWmiHelpers.ps1
PS C:\Staging> Set-ShellLauncherBridgeWmi -FilePath .\CustomShell.xml
The property 'ShellLauncher' cannot be found on this object. Verify that the property exists and can be set.
At C:\Staging\ShellLauncherBridgeWmiHelpers.ps1:16 char:5
+     $AssignedAccessCsp.ShellLauncher = $EscapedXml
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : PropertyNotFound

Set-CimInstance : Cannot bind argument to parameter 'InputObject' because it is null.
At C:\Staging\ShellLauncherBridgeWmiHelpers.ps1:17 char:34
+     Set-CimInstance -CimInstance $AssignedAccessCsp
+                                  ~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidData: (:) [Set-CimInstance], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.Management.Infrastructure.CimCm
   dlets.SetCimInstanceCommand

It seems like the problem is caused by Get-CimInstance -Namespace "root\cimv2\mdm\dmmap" -ClassName "MDM_AssignedAccess" is returning an empty object.

Tested system: Windows 10 IoT Enterprise LTSC 2021 21H2 (x64 edition) with Client-EmbeddedShellLauncher and Client-EmbeddedLogon enabled using DISM.
image

This problems is also reported on microsoft/Windows-IoT-Samples#84

forderud added a commit to forderud/Windows-iotcore-samples that referenced this issue May 5, 2022
Fixes microsoft#489 by more clearly documenting that PowerShell needs to run using the `System` account, or else the script will fail.
@forderud forderud linked a pull request May 5, 2022 that will close this issue
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant