Blog Posts tagged with Systems Management

Ask a question

Deploying Adobe Flash Player (currently with SCCM2012 (Current Branch ver. 1610) previously removing all older versions.

Updated 2/8/2017: Just used the same script with minor modification of file names and log names in the script. It still worked as intended for latest version both ActiveX and Plug-In.

I have been managing software deployments and updates/patching with SCCM 2012 (latest version 1607) in our organization with about 5300 workstations in the production environment. We have 3rd party software (Shavlik) installed to manage software updates, but I noticed that it is not always perfect for situations where multiple major versions of the software is installed. During my testing I tried to deploy Adobe Acrobat Reader DC to replace Reader 11 and Adobe Flash Player replace older versions of Flash (we had some old ones like 13, 15, 18, 21, 22).  After the patches deployment, I noticed that it will bring up the patch level to the current one , given it's been approved and downloaded in Shavlik. In other words, it will not upgrade the major version of the product ( from Adobe Reader 11 to DC , or from Flash 18 to 23). Configuring SCCM application with just plain .msi installer also doesn't remove older major versions of the Flash players.

So, I had to come up with the solution to remove older version and install new one during deployment process. 

   I decided to use powershell script to handle that installation/upgrade process, and then deploy it within an application (not the package or Task Sequence). 

Here are two scripts I used to deploy (ActiveX and Plug-in): 


if(!$PSScriptRoot){ $PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent } #In case if $PSScriptRoot is empty (Older version of powershell).  

#Close all open instances of Internet Explorer
Get-Process | ? { $_.ProcessName -match 'msiexec' } | Stop-Process -Force
Get-Process | ? { $_.ProcessName -match 'FlashUtil' } | Stop-Process -Force
(New-Object -COM "Shell.Application").Windows() | ? { $_.Name -like "*Internet Explorer*" } | % { $_.Quit()
     [Runtime.Interopservices.Marshal]::ReleaseComObject($_) }
Get-Process | ? { $_.ProcessName -match 'iexplor' } | Stop-Process -Force

#Uninstall older version of Flash ActiveX
Get-WmiObject -Class Win32_Product | Where-Object {($_.Name -LIKE "*Flash*ActiveX*") -And ($_.Vendor -LIKE "*Adobe*")} | Foreach-Object {
  $UninstallFlashArgs= "/x", "`"$($_.IdentifyingNumber)`"", "/qn", "/L*v `"C:\Windows\Logs\Adobe_Flash_ActiveX_Uninstall.log`""
  Start-Process msiexec.exe -ArgumentList $UninstallFlashArgs -Wait

Try    {
$FlushActiveXInstallArgs="/i","`"$PSScriptRoot\install_flash_player_23_active_x.msi`"","/qn","/L*v C:\Windows\Logs\Adobe_Flash_ActiveX_23.0.0.205_Install.log"
Start-Process msiexec.exe -ArgumentList $FlushActiveXInstallArgs -Wait -ErrorAction Stop -ErrorVariable ErrorDescription
$Result= [System.Environment]::ExitCode
If (!(Test-Path -Path 'C:\Program Files (x86)')) { Copy-Item -Path `"$PSScriptRoot\mms.cfg`" -Destination C:\Windows\System32\Macromed\Flash\mms.cfg -Force } Else {Copy-Item -Path `"$PSScriptRoot\mms.cfg`" -Destination C:\Windows\SysWow64\Macromed\Flash\mms.cfg -Force}

Catch  {
        $Result = [System.Environment]::Exitcode


if(!$PSScriptRoot){ $PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent } #In case if $PSScriptRoot is empty (Older version of powershell).  

#Close all open instances of MSIExec.exe and open Flash Player
Get-Process | ? { $_.ProcessName -match 'msiexec' } | Stop-Process -Force
Get-Process | ? { $_.ProcessName -match 'FlashUtil' } | Stop-Process -Force

#Un-Install all versions of Adobe Flash Players
Get-WmiObject -Class Win32_Product | Where-Object {($_.Name -LIKE "*Flash*NPAPI*") -And ($_.Vendor -LIKE "*Adobe*")} | Foreach-Object {
  $UninstallFlashArgs= "/x", "`"$($_.IdentifyingNumber)`"", "/qn", "/L*v `"C:\Windows\Logs\Adobe_Flash_PlugIn_Uninstall.log`""
  Start-Process msiexec.exe -ArgumentList $UninstallFlashArgs -Wait -ErrorAction Stop -ErrorVariable ErrorDescription

# Install_Flash_Player_22_plugin.msi for all versions of Windows ( 7, 8, 8.1, 10 )
Try    {
$FlushPlugInInstallArgs="/i","`"$PSScriptRoot\install_flash_player_23_plugin.msi`"","/qn","/L*v C:\Windows\Logs\Adobe_Flash_PlugIn_Install_23.0.0.205.log"
Start-Process -FilePath msiexec.exe -ArgumentList $FlushPlugInInstallArgs -Wait 
$Result= [System.Environment]::ExitCode

If (!(Test-Path -Path 'C:\Program Files (x86)')) { Copy-Item -Path `"$PSScriptRoot\mms.cfg`" -Destination C:\Windows\System32\Macromed\Flash\mms.cfg -Force } Else {Copy-Item -Path `"$PSScriptRoot\mms.cfg`" -Destination C:\Windows\SysWow64\Macromed\Flash\mms.cfg -Force}

Catch  {
        $Result = [System.Environment]::Exitcode


I also have mms.cfg file (config file that disabled Auto-updates) in the same folder:

AutoUpdateDisable = 1  #Disables Auto-Update of Adobe Flash Player 

I created my source directory for this application and placed all files in there. 

After downloading .msi installer files from Adobe distribution site into the same source directory on your network source location I  had 5 files in the same folder:xDX7V4.bmp

Once all files are ready, I created 2 applications: one for Adobe Flash Player ActiveX (for IE), and second one for Adobe Flash Player Plug-In ( for Firefox, etc.) . 

For each application, I started Create Application Wizard and followed all steps pointing to correct location, and the .MSI installer (for ...Active_x.msi or ...Plugin.msi in the directory above). After its completed, I just modified  Application Catalog, User Experience, and Requirements (not to deploy on Windows 8.x or Windows 10 for ActiveX - Plug-In version can be deployed to Windows 8.x and 10) and Programs of the Deployment Type to start correct .ps1 scripts with powershell.  

Here how ActiveX app properties look like:


You can use your favorite search engine to look for and download Icon for you application to be displayed in the Software Center.


Here is how my Deployment type looks like:




As for the Installation program I have this command: 

C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -WindowStyle Hidden -ExecutionPolicy Bypass -file .\Install_Flash_ActiveX.ps1

( Keep in mind, If your company policy for powershell execution is set for signed or remote signed, make sure to modify the install command to reflect that and sign those PS script files).

And for uninstall program: msiexec /x {6E6D2BB7-B844-4842-B62D-0A7F0AA7884E} /q (that code could change if you have different version of the installer .msi file or different language) - just browse to that .msi file during creation of the Application wizard to get correct code auto-generated here.     

Detection Method was automatically generated during the Create Application Wizard too. 




In the Requirements tab I limit deployments only to those 3 Operating Systems: Windows XP, Vista, 7. 

Adobe Flash Player ActiveX cannot be installed on Windows 8.x and Windows 10 with .msi installer. They should be upgraded with Windows Update.   

You can specify Application Supersedence, If you have older versions of the Flash Player deployed with SCCM. Please note that this selection is irrelevant to which version will be uninstalled with the script. It will just mark this application as superseding one of those older versions you might have deployed prior. When you deploy that script , you don't have to worry about making sure that "Uninstall Program" of your old Applications Types works.  Powershell script checks for all older versions of the apps, uninstalls them then installs new version.


After application is created, distribute content to your Distribution points, retire old versions of the Adobe Flash Player applications and deploy your new Application. Also, If you install Flash Player during OS Deployment, don't forget to update your Task Sequences to install your latest applications. 

P.S. I use those powershell scripts with some minor modifications to deploy other software. It captures return code of the .msi installer and passes it the SCCM. Some installers (not those for Adobe Flash players described above) require computer reboot. By modifying return codes (which is passes on the script end), depending on that return code in the Application Deployment Type properties you can configure to let SCCM handle reboots during deployment configuration. 

Feel free to use those scripts and techniques in your deployments. and let me know If you have better ways deploy those upgrades of older apps.


View comments (9)

ScriptLogic and Realtimepublishers Launch Windows Desktop Administration eBook

Definitive Guide is a Must Read for Every Network Administrator

Pompano Beach, FL – January 28, 2003 – ScriptLogic Corporation (, the leader in desktop administration software for Windows-based networks, and, Inc., the worldwide leader in corporate sponsored e-publishing, today announced the release of The Definitive Guide to Windows Desktop Administration. This new eBook, sponsored by ScriptLogic and authored by Bob Kelly, one of the industry’s top Windows management experts, provides valuable guidance and real-world examples for creating an efficient desktop administration plan.

“We are very excited to sponsor The Definitive Guide to Windows Desktop Administration,” said Jason Judge, CEO of ScriptLogic Corporation. “This eBook provides its readers with great, practical information about how to lower the total cost of ownership of their Windows-based networks-- something we know a lot about. The eBook complements our goal of helping customers reduce the time and money spent maintaining their networks.”

The Definitive Guide to Windows Desktop Administration examines the life cycle of Windows desktop administration from the initial OS deployment to change management through best practices. Topics included in this eBook will help readers learn how to do the following:

Reduce Help desk and administration costs and increase user productivity

Define and automate administration tasks using the latest tools and technologies

Manage security with Group Policy and desktop lockdown

Manage user profiles and map network resources

Embrace ‘best practices’ and script custom solutions

Exclusive to ScriptLogic, The Definitive Guide to Windows Desktop Administration will be published on a chapter-by-chapter basis, as it is written, providing an in-depth look at how to manage the Windows desktop. Registered readers will receive email notification when each chapter of the eBook is made available for download. Readers can register now for the eBook at

“ScriptLogic is a well established leader in the Windows desktop administration arena and we are very excited to be partnering with them to make The Definitive Guide to Windows Desktop Administration available to our readers,” said Sean Daily, CEO of Realtimepublishers. “In these challenging economic times, it is even more important for enterprises to reduce TCO through efficient desktop administration and we know our readers will appreciate this free resource.”

The Definitive Guide Series

The Definitive Guide eBook series provides timely IT content written for technical professionals, including system administrators, senior IT personnel, advanced users, and consultants. The titles in this series provide a wealth of information that goes beyond whatÂ’s found in product manuals and white papers, and are written by expert authors who are veterans in their respective fields. The Definitive Guide series, like all RealtimepublishersÂ’ series, are high-quality eBooks that are free to readers on the Web sites of industry-leading, high-tech companies around the world.

About The Author

Bob Kelly is the founder of and author of an upcoming book about the KiXtart scripting language. Bob is recognized as an industry expert in the area of application and OS deployment—writing, speaking and consulting on these and other related topics. With 13 years of experience in engineering and support, he currently works as the principal consultant in the support of several enterprise networks providing scripting, repackaging, migration, and implementation services at Integrated Data Systems in Chantilly, VA

About ScriptLogic

ScriptLogic Corporation is the leader in desktop administration software for Microsoft Windows-based networks. ScriptLogic, its award-winning, patent-pending, flagship product is the first commercial software to combine logon scripting, group policies and user profile management – into an intuitive graphical management console supporting all 32-bit Windows platforms (95, 98, Me, NT, 2000 and XP). An innovative, multi-functional solution, ScriptLogic eliminates redundant tasks, repeated trips to each desktop, maintaining multiple batch files and many other time consuming, labor-intensive activities – leaving IT staff free to concentrate on more critical issues. With deployments ranging from 10 to over 40,000 seats, ScriptLogic offers significant benefits to any size network. ScriptLogic, a privately held company, is headquartered in Pompano Beach, Florida and can be reached at (954) 861-2300 and on the web at

About is the worldwide leader in corporate-sponsored e-publishing. The company is revolutionizing the publishing industry through its unique approach of creating high-quality titles and publishing them at no charge to readers on the Web sites of industry-leading companies around the world. Current Realtimepublishers eBook sponsors include Citrix Systems, Microsoft, NetIQ, New Moon Systems, Quest Software, Aelita, and more. For information about Realtimepublishers and available eBooks, please visit

Be the first to comment

Copying files from SMS Distribution points using command line

When using a command line with SMS (.cmd) it will default to using the current windows path.

Using this command will insert the current path which is hany when rolling out from multiple distribution points as it is updated depending on what server share its in.

For example you would use this line:

xcopy.exe "%~dp0*.*" c:\temp /E /I /Q /H /Y

The %~dp0 is replace with the current server path.

Be the first to comment

How TO: Track Windows and Office Product Keys

I’ve been getting a lot of request for this in my trainings, so here it is. 
At the end of this post, you will have all the tools you need to track your Windows product keys and Microsoft office product keys. 
They way this works is we find the keys using nirsoft's keyfinder program. 
Next a VBS writes the keys to the registry. 
Finally we tie it all together with custom inventory rules. 

Requirements:Product Finder (now form Nirsfot) 
Here is the link to the portable version 

First thing we need to do is copy this VBS code into notepad and save it as keys.vbs 

Option Explicit

Dim objFSO			
Dim objTextFile
Dim winKey 
Dim officeKey
Dim strFile
Dim arrKeys
Dim i

Const ForReading = 1
Const winCDLine = "Windows"
Const officeCDLine = "Microsoft Office"
Const noViso = "Visio"
Const officeKeyReg = "offKey"
Const winKeyReg = "winKey"

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.OpenTextFile _
    ("keys.csv", ForReading)

'Read the file into the array
strFile = objTextFile.ReadAll
arrKeys = Split(strFile, vbCrLf)

For i = LBound(arrKeys) To UBound(arrKeys)
	'try to find the windows product key
		winKey = getKey(arrKeys(i))
		writeReg winKey,winKeyReg	
	End If
	'try to find the office product key
	If(InStr(arrKeys(i),noViso)) Then
	ElseIf(InStr(arrKeys(i),officeCDLine)) Then
		officeKey = getKey(arrKeys(i))
		writeReg officeKey,officeKeyReg
	End If

Function getKey(strKeyLine)
Dim temper
Const KeyLoc = 2
Const ProdLoc = 0

temper = Split(strkeyLine,",")
getKey = temper(prodloc) & "_" & temper(KeyLoc)

End function

Sub writeReg(strValue,StrValueName)

Dim strComputer
Dim oReg
Dim wshShell

Const HKEY_LOCAL_MACHINE = &H80000002
Const strKeyPath = "SOFTWARE\TVG"
Const strKeyPath64 = "SOFTWARE\Wow6432Node\TVG"
Const is64Key = "SOFTWARE\Wow6432Node"

strComputer = "."

Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & _ 
    strComputer & "\root\default:StdRegProv")
Set WshShell = WScript.CreateObject("WScript.Shell")

'check for 64 bit
If(OS64()) Then
	oReg.CreateKey HKEY_LOCAL_MACHINE,strKeyPath64
	oReg.SetStringValue HKEY_LOCAL_MACHINE,strKeyPath64,strValueName,strValue
	oReg.CreateKey HKEY_LOCAL_MACHINE,strKeyPath
	oReg.SetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue
End If

End Sub

Function OS64()
Dim objOS
Dim colItems
Dim objItem
Dim strComputer

strComputer = "."
Set objOS = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
Set colItems = objOS.ExecQuery("SELECT OSArchitecture FROM Win32_OperatingSystem")

'this should fail on 32 bit XP
On error resume next
For Each objItem In colItems
	If(IsNull(objItem.OSArchitecture)) Then 
		OS64 = False
	ElseIf(InStr(objItem.OSArchitecture,"64") > 0) Then
		OS64 = True
		OS64 = False
	End If
On Error Goto 0

If(Err <> 0) Then 
	OS64 = False
End if
End Function
Next thing we need to do is go to the scripting module and a new script. 
For script type select Online Shell Script. 
Choose a label, select windows as the operating system and set the script to run as local system. 
Next upload produkey.cfg, produkey.exe (both found in the nirsoft folder, make sure you unzip) and keys.vbs as dependencies. 
For the script text enter the following 2 lines. 
ProduKey.exe /windowskeys 1 /officekeys 1 /iekeys 0 /sqlkeys 0 /exchangekeys 0 /extractedition 1 /scomma keys.csv
cscript.exe keys.vbs

Last thing we need to do is change the script name from to script.bat (just below the script text). 

Now that we have the keys in the registry we can start creating the custom inventory rules. 
Go to the software module and add a new item. 
Call the first one “Windows Product Key” 
Select all your windows operating systems for supported OSs. 
Finally here is the syntax for the custom inventory rule: 

Go ahead and save the software. 
Next add another item but this time call it "Microsoft Office Key" 
Highlight all the windows OSs again. 
Here is the syntax for the second piece of software. 

At this point you could also create additional software records, for example one for each office key. 
That way depending on the key you would have a unique software title. This way you could use the KBOXs built in asset management module and do licence compliance. 

Below are two reports that you can use to see what machines have what keys installed. 
Office report: 
       MACHINE M
       AND M.ID = MCI.ID
       AND S.DISPLAY_NAME = 'Microsoft Office Key'

Windows report: 
       MACHINE M 
       AND M.ID = MCI.ID 
       AND S.DISPLAY_NAME = 'Windows Product Key'

I hope this is useful. 
Thanks to vacuna for helping me put this together. 
View comments (8)

Dell KACE Koncept Series: K1000 Inventory Fundamentals


Welcome to the Dell KACE Koncept Series!  This series of blogs and videos will help provide some basic information on the K1000 and K2000 product lines.

Click here to view the video, it will open in a separate window.



This video provides information on the Inventory component of the K1000 appliance.  This information is designed to provide a brief overview of:

  • Computer Inventory
  • non-Computer Inventory
  • MIA Inventory

If you would like to provide feedback, we'd love to hear it!  You can provide comments below, rate this post, or just email and tell us what you think.

Happy KBOXing!


Technical Advisor: Chris Blake

Multimedia Producer: Melinda Richards

View comments (3)
Showing 1 - 5 of 307 results

Top Contributors

Talk About Best Practices