The application was unable to load a required virtual machine component. Please contact the publisher of this application for more information.

Windows Updates have lately broken some software and thrown the error message “The application was unable to load a required virtual machine component. Please contact the publisher of this application for more information.”

I have put together a batch file to remove all the updates from a Windows 7 system that causes this issue.

@echo off

echo Uninstalling 3022345
wusa.exe /uninstall /kb:3022345 /quiet /norestart

echo Uninstalling 3045999
wusa.exe /uninstall /kb:3045999 /quiet /norestart

echo Uninstalling 3068708
wusa.exe /uninstall /kb:3068708 /quiet /norestart

echo Uninstalling 3071756
wusa.exe /uninstall /kb:3071756 /quiet /norestart

echo Uninstalling 3046017
wusa.exe /uninstall /kb:3046017 /quiet /norestart

echo Uninstalling 3060716
wusa.exe /uninstall /kb:3060716 /quiet /norestart

echo Uninstalling 3080149
wusa.exe /uninstall /kb:3080149 /quiet /norestart

echo Uninstalling 3101746
wusa.exe /uninstall /kb:3101746 /quiet /norestart

echo Uninstalling 3121212
wusa.exe /uninstall /kb:3121212 /quiet /norestart

echo Uninstalling 3088195
wusa.exe /uninstall /kb:3088195 /quiet /norestart

echo Uninstalling 3093513 with Restart
wusa.exe /uninstall /kb:3093513 /quiet
echo Forcing Restart...
END

Save as a .bat file and run. It will get the to end update and force a restart of the machine.

Useful SCCM 2012 Device Collection Queries

Below are some useful SCCM Device Collection Queries. Some of these may require the device collection to be Dynamic.

Device Collection based on OU

SELECT * from SMS_R_System WHERE SMS_R_System.SystemOUName = "YOURDOM.LOCAL/Computers/YourCustomOU"

Device Collection Laptops/Notebooks

SELECT * FROM SMS_R_System INNER JOIN SMS_G_System_SYSTEM_ENCLOSURE ON SMS_G_System_SYSTEM_ENCLOSURE.ResourceID = SMS_R_System.ResourceID WHERE SMS_G_System_SYSTEM_ENCLOSURE.ChassisTypes in ( "8", "9", "10", "14" ) 

64bit Devices

SELECT * FROM SMS_R_System INNER JOIN SMS_G_System_COMPUTER_SYSTEM ON SMS_G_System_COMPUTER_SYSTEM.ResourceID = SMS_R_System.ResourceID WHERE SMS_G_System_COMPUTER_SYSTEM.SystemType = "x64-based PC" 

Windows 8 Devices

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
INNER JOIN
SMS_G_System_COMPUTER_SYSTEM on SMS_G_System_COMPUTER_SYSTEM.ResourceId = SMS_R_System.ResourceId
WHERE
SMS_R_System.OperatingSystemNameandVersion
LIKE
"%Workstation 6.2%" or SMS_R_System.OperatingSystemNameandVersion LIKE "%Windows 8%" 

All Servers

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 INNER JOIN SMS_G_System_SYSTEM ON SMS_G_System_SYSTEM.ResourceId = SMS_R_System.ResourceId WHERE SMS_G_System_SYSTEM.SystemRole = "Server"

Domain Controllers

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.PrimaryGroupID = "516"

Computer Name Contains…

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 INNER JOIN SMS_G_System_SYSTEM ON SMS_G_System_SYSTEM.ResourceID = SMS_R_System.ResourceId WHERE SMS_G_System_SYSTEM.Name LINK "%COMP%" ORDER BY SMS_R_System.Name

Powershell – List and Assign Office 365 Licenses

Microsoft are adding more and more functionality for administrators in Office 365 – Unfortunately, there is still no ‘easy’ and quick way to assign a new license, in bulk, to a lot of existing¬†users. Specifically, the OFFICESUBSCRIPTION_STUDENT that was introduced to provide Office 365 licenses to Students was the one I was looking for.

Below are some quick Powershell commands to get you started (assuming that you know how to connect to Office 365 Exchange Online via Powershell)

List SKUs / Licenses Available
This will list your organisation before the SKU name, e.g. YOUR_ORG:OFFICESUBSCRIPTION_STUDENT

Get-MsolAccountSku

Add Single License to User
You can pipe this | with Get-MsolUser to set the license on a single user.

Set-MsolUserLicense -AddLicenses YOUR_ORG:OFFICESUBSCRIPTION_STUDENT

Bulk Add by Domain Name
If you have multiple domains, or sub-domains you can assign licenses in bulk easily. Replace the ‘your org’ strings below to match your setup though.

Get-MsolUser -DomainName staff.yourorg.com -All | Set-MsolUserLicense -AddLicenses YOUR_ORG:OFFICESUBSCRIPTION_STUDENT

You can use multiple filters on the last command and just pipe the second command using the |. This could be by name, by group or domain as show above.