12 December 2013

Verify SCCM can see Application GUIDs

I was deploying an application through SCCM and it continued to fail every time, although the app was completely installed. I knew it had to be with the verification process. I went through and entered all of the GUIDs for the apps being installed as the verification. I wrote the script below to verify WMI could see the GUIDs and come to find out, they were not registered in the HKCR, but the apps were registered in the HKLM, which makes it show up in the add/remove programs. This resolved my issue of the failure.

Create a text file named GUIDs.txt and enter a series of GUIDs. The script will read these GUIDs and then query WMI to see if they are registered. If they are not registered, nothing appears. If they are registered, all pertinent WMI data is displayed. At the end, it will list all of the GUIDs that WMI could not find. At this point, remove those GUIDs from the SCCM verification and the package should install with no issues.

You can download the script from here.

 #*******************************************************************************  
 #   Author: Mick Pletcher  
 #    Date: 12 December 2013  
 #  
 #   Program: Verify GUIDs  
 #*******************************************************************************  
   
 cls  
 Set-Variable -Name App -Value $null  
 Set-Variable -Name File -Force  
 Set-Variable -Name GUID -Force  
 Set-Variable -Name RelativePath -Scope Global -Force  
   
 $MissingGUIDs = @()  
 Function GetRelativePath {  
      $Global:RelativePath=(split-path $SCRIPT:MyInvocation.MyCommand.Path -parent)+"\"  
 }  
   
 GetRelativePath  
 $File = Import-Csv -Header GUID1 $Global:RelativePath"GUIDs.txt"  
 Foreach ($GUID in $File) {  
      #Write-Host $GUID.GUID1  
      #Get-WmiObject win32_product | Where-Object {$_.IdentifyingNumber -match "{5783F2D7-D004-0409-1102-0060B0CE6BBA}"}  
      $App = Get-WmiObject win32_product | Where-Object {$_.IdentifyingNumber -match $GUID.GUID1}  
      $App  
      If ($App.Name -like "") {  
           $MissingGUIDs += $GUID.GUID1  
      }  
      $App = $null  
 }  
 Write-Host  
 Write-Host "Missing GUIDs"  
 Write-Host "-------------"  
 $MissingGUIDs  
   
 #Cleanup Global Memory  
 Remove-Variable -Name App -Force  
 Remove-Variable -Name File -Force  
 Remove-Variable -Name GUID -Force  
 Remove-Variable -Name MissingGUIDs -Force  
 Remove-Variable -Name RelativePath -Scope Global -Force  
   

Related Posts:

  • Import and Apply Local GPOs This script will import and apply a local GPO using the local GPO utility, ImportRegPol.exe, located here. The script is a wrapper that makes implementing this utility a snap. All that has to be done is to use the Micr… Read More
  • Cleaning up old systems in Active Directory, SCCM, and Antivirus Every place I have worked, there has been the issue of systems being in SCCM, AD, and antivirus that no longer existed. The is often caused by systems being overlooked when a user departs the company, a laptop that gets put… Read More
  • List all Local Administrators on a Computer I wrote this script to generate a list of local administrators on a PC. It saves the output to a text file at a central repository. The text file is named the computer name and contains a listing of all the local administr… Read More
  • Replicate Permissioning Here is a script I have written that will replicate the permissions between two folders including all subfolders and file permissions. Execute the script and you will be prompted for the source and destination folders. It w… Read More
  • Uninstall All Printers Recently, we upgraded our print servers and needed to reinstall all of the printers. This script will uninstall all printers. I deployed this script out and had it run as the user and a GPO reinstalled the printer with the … Read More

0 comments:

Post a Comment