Suppressing notifications for SCCM App-V Packages

App-V packages/programs do not give you the option to suppress notifications for the program.  They pop up by default.  You can override this by running the following VBScript.  Save the code to a file ending with .vbs, change the packageID value, then run it.  No more notifications!

strSMSServer = "."
strPackageID = "XYZ00001"
strProgramName = "[Virtual application]"

Set objLocator = CreateObject("WbemScripting.SWbemLocator")
Set objSCCM = objLocator.ConnectServer(strSMSServer, "root\sms")
Set Providers = objSCCM.ExecQuery("SELECT * From SMS_ProviderLocation WHERE ProviderForLocalSite = true")
For Each Provider in Providers
If Provider.ProviderForLocalSite = True Then
Set objSCCM = objLocator.ConnectServer(Provider.Machine, "root\sms\site_" & Provider.SiteCode)
' strSMSSiteCode = Loc.Sitecode
End If
Next

Set objProgram = objSCCM.Get("SMS_Program.PackageID='" & strPackageID & "',ProgramName='" & strProgramName & "'")

ProgramFlags = objProgram.ProgramFlags
WScript.Echo "Flags for " & strPackageID & ":" & strProgramName & " currently set to " & ProgramFlags
WScript.Echo "Adding 0x00000400 (COUNTDOWN. The countdown dialog is not displayed)" ' see ConfigMgr SDK for details ("SMS_Program Server WMI Class")
ProgramFlags = ProgramFlags + 1024
WScript.Echo "Set flag to: " & ProgramFlags
objProgram.ProgramFlags = ProgramFlags
objProgram.Put_

Filed under: App-V, SCCM | Posted on March 8th, 2011 by CharlieMaurice

Leave a Reply

RSS Feed

Categories

Archives

Blogroll

Meta

Copyright © 2018 Charlie's Tech Ramblings. All rights reserved.

Tech Blue designed by Hive Designs • Ported by Free WordPress Themes