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


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

Where is Component Service Manager in SCCM 2012?

If you aren’t in there a lot, it’s easy to forget where to find the Service Manager in SCCM 2012.  Service Manager is used for stopping an individual Configuration Manager component, instead of restarting the SMSExec service or restarting the server.

To find it, Browse to Monitoring -> Overview -> System Status -> Component Status

Look up at Home ribbon.  You should see a “Start” button.  Click that and choose “Configuration Manager Service Manager


Posted in SCCM 2012 | 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



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

SCCM 2012 Task Sequence Failing With Error Code 0x80004005

I had a very unusual issue come up where a task sequence continuously failed right after WinPE booted.

We had complaints that our task sequence was failing on 2 existing laptops.  After checking around to make sure it wasn’t an SCCM infrastructure issue, I started looking at the laptop.

The boot image would load, then go to the default startup screen during the image process.  When hitting “next”, it immediately failed with the Error Code 0x80004005.  I’ve seen this error code in the past and usually came back to network connectivity.  Fired up the command prompt, and we had an IP. We can rule that out.

I started asking more questions about the laptop itself.  It turns out these 2 laptops recently had the motherboards replaced.  So my thinking goes back to network… obviously we have a new NIC in the laptop if the motherboard was replaced.  I open up CMtrace in WinPE, and look again.  The same 0x80004005 (failed to get client identity).




Now it’s starting to stir my memory…. I’ve seen this before.  I am thinking motherboard replacement… I wonder what the BIOS date/time is set to.  When building boot media, you select the self signed certificate with a distinct date range.  Sure enough, the BIOS on the laptop is set to over a year ago.  Once I changed it back to the current date/time – everything works!  BIOSdatetime

Posted in SCCM 2012 | 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




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

Script to Set Cache Size on SCCM Clients

Here’s a quick and easy way to set or change the cache size on SCCM clients.  If your organization is anything like mine, the 5 GB default is never enough, especially using Nomad.

I also set this in my OSD task sequence for new PC builds.

Just create a package and run the following VBScript – example being a command line — %systemroot%\system32\Wscript.exe SCCMCache.vbs

Dim ClientResource
Set objShell = WScript.CreateObject (“”)
Set ClientResource = CreateObject(“UIResource.UIResourceMgr”)
Set CacheInfo = ClientResource.GetCacheInfo
CacheInfo.TotalSize = 27680 ‘  Change this to your new cache size in MB

Posted in Application Packaging, SCCM 2007, SCCM 2012, Scripts | Leave a comment

ConfigMgr 2012 Update Scan Fails and Shows Incorrect Compliance

I ran into this a few months ago, however I am still seeing a few issues even after sending a script out to resolve it.  I figured I’d write a quick blog to show everyone what I did to resolve the issue.  It’s also important to note that the SCCM 2012 R2 SP1 update is also supposed to help with this.


After deploying a new software update group, I immediately notice that about 1500 workstations showed as “compliant”.  How can this be since I haven’t even deployed any patches?  At first I thought maybe Windows Update was turned on somehow by mistake?  Nope.

After troubleshooting I found this in the WindowsUpdate.log file, which is located in the Windows directory.

WARNING: ISusInternal::GetUpdateMetadata2 failed, hr=8007000E

It seemed that the clients were failing to scan against the WSUS patch repository.


The Fix:

It’s important to note that the bug only seemed to affect x86 Windows 7 clients.  It appears this bug was a memory leak in the Windows Update service.

I wrote the following script and sent it out to all x86 Windows 7 workstations.

@echo off

net stop wuauserv
Sc config wuauserv type= own
cd c:\windows
ren SoftwareDistribution SoftwareDistribution.old
net start wuauserv

start /wait wusa.exe Windows6.1-KB2728379-x86.msu /quiet /norestart


KB2728379 can be downloaded from here:

You also may want to go through your WSUS console and decline any superseded update, and unselect any outdated operating systems like XP, Office 2003, Server 2003, etc.  This makes the payload of WSUS to clients smaller as it doesn’t need to worry about these old outdated OS’s.  It’s also worth noting that I saw this behavior in both SCCM 2007 and 2012.  This makes sense, since it’s technically a Windows Update service/WSUS bug, which SCCM piggybacks off

Posted in SCCM 2007, SCCM 2012, WSUS | Tagged , , , | Leave a comment

SCCM 2012 Console Unable to Open

While installing the SCCM 2012 console on workstations for our PC techs to use, I came across a very strange problem.  A tech had installed the console on his machine, and when launching it the error “Configuration Manager cannot connect to the site (site server)”


After verifying all permissions were set correct, I found this was a machine issue, not a permissions issue.  The tech could login to the SCCM console on another machine just fine.

After further inspection, I saw the following entries in the C:\Program Files\Microsoft Configuration Manager\AdminConsole\AdminUILog\SMSAdminUI.log file

The performance counter ‘# exceptions’ was not found


Took awhile to figure this out, but it seems to work on most machines

  • Open a cmd prompt as admin on the problem machine
  • run “LODCTR /R”


  • Uninstall and reinstall SCCM console
  • Restart, and it should work!
Posted in SCCM 2012 | Tagged , | Leave a comment

Clear SCCM 2012 PXE Advertisements

I just spent a half day searching through SCCM collections, databases, PXE logs, etc to find a fairly easy fix (once you find it!!)  Disclaimer:  I’m using IE Nomad with PXE Lite, however this should work on straight SCCM PXE boot from DP’s as well.

The symptom is something like this:

  • PXE boot a bare metal machine and SCCM starts imaging the workstation
  • For whatever reason (network, hardware, bad task sequence, drivers, etc) the image fails.
  • You restart the PC and try to PXE boot again.
  • Instead of PXE booting – you get the following message:  PXE Boot aborted. Booting to next device…

It seems the machine is kind of stuck in limbo at this point.  The only other way I could complete the image is use physical boot media.

Some of the troubleshooting steps I took before finding the solution:

  • Searched for the workstation MAC address in SCCM – both using a collection query and SQL.  No hits
  • Searched for IP – no hits
  • Searched by MININT name – no hits
  • Right click collections and select “clear require PXE advertisements” – no luck


Go into SCCM 2012 Console – Assets and Compliance – Device Collections – All Desktop and Server Clients

Search for Unknown





Right click any unknown records and delete them.  Then try the PXE boot again.It should work!


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

Finding Workstations or Servers Without SCCM Client Installed

A quick query that creates a collection of workstations or servers missing the SCCM client.  This is especially useful for environments without the SCCM client push enabled.

Step 1

Create a collection that you will use as a limiting collection – for example “All Windows 8 Devices”, “All Windows Servers”, etc.  In this example, we’ll use all Windows Servers.  Limit this to All Systems to catch both cliented and un-cliented machines.

An example code would look like this.

select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System where (SMS_R_System.OperatingSystemNameandVersion like “Microsoft Windows NT Server 5%” or SMS_R_System.OperatingSystemNameandVersion like “Microsoft Windows NT Advanced Server%” or SMS_R_System.OperatingSystemNameandVersion like “Microsoft Windows NT Server 6%”)

Step 2

Create another collection called something like “All Servers Without SCCM Client.  You’ll limit this collection to the one created above.

SQL code for this query is:

select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System where (SMS_R_System.Client is null  or SMS_R_System.Client = 0) and SMS_R_System.Name != “Unknown”


This should give you a collection of servers that do not have the client installed.  You can use a ping test to see which ones are active and push the client.

Posted in SCCM 2007, SCCM 2012 | Tagged , , , | Leave a comment
« Older