torsdag den 15. februar 2018

unable to find a partition on the system disk that can be set as active

Case:

Trying to run unknown computer support in sccm and prestage the device to make it automatically prestage a boot image and start deployment.
In this case we use a HTA, it could be powershell or other script languages as prestart command.

Error:

When unknown computer become known, and start to prestage the winpe file to continue the OSD journey, it fails. Computer will boot into windows or in a system failure.


If we look into the logs x:\windows\temp\smsts\smsts.log it says:


unable to find a partition on the system disk that can be set as active




So the currently loaded configuration are not able to save binaries to the current harddrive state. This could be because of booting to winpe legacy and the harddrive formatet as GPT or vice versa.
simply does not harmonize.

Solution:


First we need a solution to determine which state the winpe will be bootet into. It can be 2 states, either UEFI or legacy. We need to know this because we need to format the disk.




Create a vbscript and insert this code:


set env = CreateObject("Microsoft.SMS.TSEnvironment")
set wshell = CreateObject("Wscript.Shell")



UEFI = env("_SMSTSBootUEFI")


If UEFI = "false" then
 wshell.run "DISKPART /s Diskpart.txt", 1, True
else
 wshell.run "DISKPART /s Diskpartuefi.txt", 1, True
End if



wshell.run "X:\sms\pkg\sms10000\HTA_Dynamic.hta", 1, true


As you see there is 2 txt files in the code. We need to create those as well. Use notepad and paste the code into them.


diskpart.txt:
select disk 0
clean
create partition primary
select partition 1
format fs=ntfs quick
assign letter=C
active



diskpartuefi.txt:
select disk 0
clean
convert gpt
create partition primary size=2048
format quick fs=ntfs label="Windows RE tools"
assign letter="T"
create partition efi size=512
format quick fs=fat32 label="System"
assign letter="S"
create partition msr size=128
create partition primary
format quick fs=ntfs label="Windows"
assign letter="C"





Save all 3 files on a unc path where you can reach them.


ex.
\\share\pkgsource$\OSD\x64\Windows PE\Media\Deploy



go to sccm console
\Software Library\Overview\Operating Systems\Boot Images



And choose properties on the boot image used for unknown computer support.
Choose Customization




Insert commandline
wscript.exe X:\sms\pkg\sms10000\RunHTA.vbs

tick include files and point to the unc path where you put the 3 files created earlier.

Save and update distribution point, and your unknown computer support will always be in sync no matter if you change from UEFI to Legacy or vice versa.


Happy deployment.

onsdag den 14. februar 2018

SYSPRP Failed to remove apps for the current user: 0x80073cf2.

Case:

Trying to create new image of inplace upgraded Windows 10 can result in sysprep error due to windows store apps.

Error:

Error found in syp
In this case it was the miracast app that failed.

SYSPRP Package Windows.MiracastView_6.3.0.0_neutral_neutral_cw5n1h2txyewy was installed for a user, but not provisioned for all users. This package will not function properly in the sysprep image.
SYSPRP Failed to remove apps for the current user: 0x80073cf2.

Generally this would be easy to deal with because we have powershell.

Remove-AppxPackage -Package YourApp

But in this case this will only result in errors and more errors. It simply does not work.

Solution:


 On a working windows 10 1703 copy folder C:\Windows\MiracastView
  1. Copy MiracastView folder to your upgraded virtual image machine to the same location.
  2. Open Powershell with administrativ permissions.
  3. Get-AppxPackage -name "*mira*" (screenshot 1)
  4. Copy PackageFullName
  5. Remove-AppxPackage -Package Windows.MiracastView_6.3.0.0_........ (screenshot 2)

Screenshot1









Screenshot 2





Miracast app will be removed, and you can start sysprep again. 

SoftwareCentral 5.7 release - What's new!?

What’s new in SoftwareCentral 5.7? To start with, this blog will not show all new changes, but the once that I thought would be great to ...