vrijdag 23 april 2010

Suppress SCCM notification for App-V

Since R2 App-V is strongly integrated into SCCM.

A most common scenario will be that for instance a user logs on and the icon of avirtual application appears automatically on his desktop, ready to stream the application.

Default, you first get a notification (balloon in system tray) that the user has to click before the icon appears on its desktop.

That's probably something you don't want to have. You probably prefer if the user logs on the icon will be available without user interaction.

As you might know you can suppress notification with SCCM on programs of SCCM packages... BUT App-V Packages do not have programs, so we cannot select this option.

At this point some scripting will be required.
With following script you suppress notifications for App-V packages.

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_


Enjoy!
Locations of visitors to this page