Remove all Windows 10 “Metro” style Apps from Reference Image

Many times Windows 10 sysprep will fail when the built-in Windows 10 apps are present.  The reasons can vary, however most times I just remove them anyway in my reference image.

This will remove most of the junk apps in the Windows 10 start menu, but may not remove the shortcuts themselves.

Use these 2 lines in your reference image task sequence, or run them manually before sysprep.

Get-AppxProvisionedPackage –online | Remove-AppxProvisionedPackage -online

Get-AppxPackage –AllUsers | Remove-AppxPackage

 

While we’re at it, we may as well remove Candy Crush, Twitter, etc… the Consumer Experience apps.  Add this to your task sequence or just edit the base reference image.

Import this registry entry.

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CloudContent]
“DisableWindowsConsumerFeatures”=dword:00000001

Posted in MDT, MDT 2010, Powershell, SCCM 2012 | Tagged , , , | Leave a comment

View Add/Remove Program Info in Powershell

A quick and easy way to view almost everything you need to know about your add/remove programs is using the “gwmi” powershell command.

To view all options for this, just use the built-in help by typing: get-help gwmi .

To get all of the information on your add/remove programs (or technically called “Installed Software” now)… type:

gwmi -namespace “root\cimv2\sms” -class SMS_InstalledSoftware into powershell.  It may take a few seconds for everything to appear and you’ll see a huge list of all installed applications.

A coworker reminded me of the “out-gridview” command which organizes this into a much more manageable view.

The final product?  Pipe the out-gridview out and it looks like this:

 gwmi -namespace “root\cimv2\sms” -class SMS_InstalledSoftware | Out-GridView

PoweshellOutGrid

 

Everything you ever needed will be in here.  The exact name to query for when building SCCM collections, GUID, version, etc.  Limitless possibilities.  The filter is also excellent too.

Hope this helps!

 

 

Posted in Powershell, SCCM 2012, Scripts | Tagged , , , , | Leave a comment

Powershell Tips – Reboot Pending?

I’ve managed Configuration Manager 2007 and 2012 at a few organizations where reboots were suppressed for security patches.  Personally, I think 24-48 hours notice is plenty of time for users to reboot their workstations, however many times the decision is made way above my pay grade.

Pending reboots on a system can cause havoc with subsequent advertisements that go out.  I’ve seen many application failures on a system with a pending reboot.  Since most of our application deployments use a Powershell wrapper, I’ve been searching for a way to take a different path if a reboot is pending.  Some applications work just fine with a pending reboot on the system, others not so much.

The following Powershell command will let you determine in the script if a reboot is pending or not with SCCM.

Invoke-WmiMethod -Namespace root\ccm\clientsdk -Class CCM_ClientUtilities -Name DetermineIfRebootPending

Capture

Capture

 

Once you have this result, you could pipe it into anything with Powershell.  You could have it exit with a special exit code, do another action like write an entry into a log….. anything really.

I will be posting a few examples of this pending reboot check in the future.  Hope this helps.

 

Posted in Application Packaging, Powershell, SCCM 2012 | Tagged , , | Leave a comment