Jump to content


We use cookies to let you log in, for ads and for analytics. OK

Photo

How to run WPF from WinPE Task Sequence




  • Please log in to reply
11 replies to this topic

#1 Flip76

Flip76

    Newbie

  • Established Members
  • Pip
  • 7 posts

Posted 06 January 2017 - 08:45 PM

Update: Looks like PowerShell ist missing on the X:-Volume. I've only an empty folder X:\Windows\System32\WindowsPowerShell\v1.0. I updated the WIM again. Nothing happens!

 

Good evening!

 

I'm using SCCM Current Branch with MDT 2013 Update 2. I want to create a universal OS deployment task sequence with an WPF GUI.

 

I've done the following steps:

- Creating a simple WPF with Visual Basic 2015

- Implemented the XAML-Code into a PowerShell script (Show-OSConfigurator.ps1). The PowerShell script standalone starts without any errors.

- Implemented an redistributed my MDT Boot Image (only x64 in use) with the necessary optional components (NetFx, PowerShell)

- Creating a package (Show OS-Configurator) with the source files, without a program, and distributed it

- For testing I've created a new task sequence with only one step "Run PowerShell Script". I've referenced to the package (Show OS-Configurator) and have putted in the script Name (Show-OSConfigurator.ps1). The ExecutionPolicy is set to "ByPass".

- The task sequence is deployed to the "Unknown Devices" collection

 

If I run the task sequence I get an error 0x80004005.

 

I've tried serveral thinks from the web (HTA, VBS...) Nothing works!

 

Does somebody have a solution?

 

Greets

 

Flip


Edited by Flip76, 06 January 2017 - 11:04 PM.




#2 anyweb

anyweb

    Administrator

  • Root Admin
  • PipPipPip
  • 7,206 posts
  • Gender:Male
  • Location:Sweden
  • Interests:Deploying Operating systems and more with System Center Configuration Manager

Posted 07 January 2017 - 03:41 PM

hi

can you attach your smsts.log so we can see the steps and failure


Microsoft MVP > Enterprise Client Management
My linkedin profile at > linkedin.com
Follow me on Twitter > ncbrady
Follow windowsnoob.com on Twitter > windowsnoob
My blog

#3 Flip76

Flip76

    Newbie

  • Established Members
  • Pip
  • 7 posts

Posted 08 January 2017 - 06:43 PM

Hi,

 

attached the smsts.logAttached File  smsts.log   1.55MB   7 downloads



#4 anyweb

anyweb

    Administrator

  • Root Admin
  • PipPipPip
  • 7,206 posts
  • Gender:Male
  • Location:Sweden
  • Interests:Deploying Operating systems and more with System Center Configuration Manager

Posted 08 January 2017 - 06:51 PM

here's your first problem, and it will block you from getting any of this to work...

<![LOG[PowerShell is not installed]LOG]!><time="19:34:07.669-60" date="01-08-2017" component="RunPowerShellScript" context="" type="3" thread="1228" file="main.cpp:151">
<![LOG[ExecutePowerShellScript(sScriptName, sParameters, sPackageID, sExecutionPolicy, dwPSRunExitCode), HRESULT=80004005 (e:\nts_sccm_release\sms\client\osdeployment\runpsscript\main.cpp,356)]LOG]!><time="19:34:07.669-60" date="01-08-2017" component="RunPowerShellScript" context="" type="0" thread="1228" file="main.cpp:356">
<![LOG[Run powershell script failed to run, hr=0x80004005]LOG]!><time="19:34:07.669-60" date="01-08-2017" component="RunPowerShellScript" context="" type="3" thread="1228" file="main.cpp:356">
<![LOG[Process completed with exit code 2147500037]LOG]!><time="19:34:07.684-60" date="01-08-2017" component="TSManager" context="" type="1" thread="1140" file="commandline.cpp:1124">
<![LOG[!--------------------------------------------------------------------------------------------!]LOG]!><time="19:34:07.684-60" date="01-08-2017" component="TSManager" context="" type="1" thread="1140" file="instruction.cxx:805">
<![LOG[Failed to run the action: Run PowerShell Script.
Unspecified error

are you sure you've added PowerShell to the correct boot image  and that you've distributed that boot wim to your distribution points ?


Microsoft MVP > Enterprise Client Management
My linkedin profile at > linkedin.com
Follow me on Twitter > ncbrady
Follow windowsnoob.com on Twitter > windowsnoob
My blog

#5 Flip76

Flip76

    Newbie

  • Established Members
  • Pip
  • 7 posts

Posted 09 January 2017 - 07:07 AM

Yes, I've. For sure I've attached the screenshots of the properties Windows.

 

Edit: I've readded the two optional components. If I add the WinPE-PowerShell component, I get a message that the component Microsoft.NET (WinPE-NetFx4) is required, but I don't have this component for selection. In some articles I've read that this components included in the Microsoft.NET (WinPE-NetFx) component.

Attached Images

  • Task Sequence Properties.jpg
  • Boot Images Optional Components.jpg


#6 anyweb

anyweb

    Administrator

  • Root Admin
  • PipPipPip
  • 7,206 posts
  • Gender:Male
  • Location:Sweden
  • Interests:Deploying Operating systems and more with System Center Configuration Manager

Posted 09 January 2017 - 07:34 PM

when you pxe boot what is the package id of the boot image?


Microsoft MVP > Enterprise Client Management
My linkedin profile at > linkedin.com
Follow me on Twitter > ncbrady
Follow windowsnoob.com on Twitter > windowsnoob
My blog

#7 Flip76

Flip76

    Newbie

  • Established Members
  • Pip
  • 7 posts

Posted 09 January 2017 - 08:03 PM

It's "winpe.RTS0031B.wim"



#8 anyweb

anyweb

    Administrator

  • Root Admin
  • PipPipPip
  • 7,206 posts
  • Gender:Male
  • Location:Sweden
  • Interests:Deploying Operating systems and more with System Center Configuration Manager

Posted 09 January 2017 - 08:19 PM

and is that the one you added powershell to ? you can verify via the references tab of the task sequence


Microsoft MVP > Enterprise Client Management
My linkedin profile at > linkedin.com
Follow me on Twitter > ncbrady
Follow windowsnoob.com on Twitter > windowsnoob
My blog

#9 Flip76

Flip76

    Newbie

  • Established Members
  • Pip
  • 7 posts

Posted 09 January 2017 - 08:33 PM

At my task sequence I've the items Show below. Cause I'd like to see if the Powershell task sequence step were executed, I've a simple task sequence of only this one step created.

Attached Images

  • Task Sequence References.jpg
  • Task Sequence.jpg


#10 Flip76

Flip76

    Newbie

  • Established Members
  • Pip
  • 7 posts

Posted 11 January 2017 - 07:27 AM

I've now tested it with the default Boot Image x64. After integrating the required PowerShell components and redistributing the image, I've PowerShell support at my task sequence. Now I get an error 0x80070002, cause the PowerShell package could not be found. At the disk there is an empty package Folder.

 

Any further idea, how to get the PowerShell run at the MDT Boot Image?



#11 Flip76

Flip76

    Newbie

  • Established Members
  • Pip
  • 7 posts

Posted 11 January 2017 - 08:28 PM

I got it to work now!

 

After I added some new drivers to the MDT Boot Image, I could'n redistribute it. So I decided to create a new Boot Image. At the new Boot Image I've now PowerShell support and my WPF does appear at least.



#12 anyweb

anyweb

    Administrator

  • Root Admin
  • PipPipPip
  • 7,206 posts
  • Gender:Male
  • Location:Sweden
  • Interests:Deploying Operating systems and more with System Center Configuration Manager

Posted 11 January 2017 - 08:45 PM

cool, please show us a screenshot of your masterpiece and feel free to spread the love and post some sample code too :) or even a guide !


Microsoft MVP > Enterprise Client Management
My linkedin profile at > linkedin.com
Follow me on Twitter > ncbrady
Follow windowsnoob.com on Twitter > windowsnoob
My blog




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users