By default an advertised Task Sequence in SCCM (Microsoft System Center Configuration Manager) will popup a message on the client workstation indicating that there is a new application that is available to be run. This is sometimes not desirable. By default it is possible to turn off notification for a regular Software Distribution Program in SCCM via the GUI by checking the box on the Program for “Suppress Program Notifications”. This GUI option is not available from a Task Sequence, but can manually be added via VBScript.
The value that we are adding to the ProgramFlags setting is 0x00000400 (which in decimal is 1024). You can find more details about the ProgramFlags from here.
Here’s the basic process:
1. Copy the following script to your SCCM server and save as “DisableTaskSequencePopupMessage.vbs”
‘Disable the popup message on a client workstation for a Task Sequence
‘Run this VBScript on your SCCM server
strSMSServer = “.”
‘Set COUNTDOWN value to 0x00000400 in HEX
COUNTDOWN = &H00000400Set 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)
End If
Next
Set TaskSequencePackage = objSCCM.ExecQuery(“SELECT * FROM SMS_TaskSequencePackage”,,48)
For Each PackageID in TaskSequencePackage
PackageIDS = PackageIDS & VbCrLF & PackageID.PackageID & ” – ” & PackageID.Name
Next
Do
strTSID = InputBox(“Please enter the packageID that corresponds to your Task Sequence:” & vbCrLF & PackageIDS)
If strTSID = “” Then WScript.Quit ‘Detect Cancel
If strTSID <> “” Then Exit Do ‘Detect value strTSID.
‘MsgBox “You must enter a numeric value.”, 48, “Invalid Entry”
Loop
Set objProgram = objSCCM.Get(“SMS_TaskSequencePackage.PackageID='” & strTSID & “‘”)OldProgramFlags = objProgram.ProgramFlags
ProgramFlags = objProgram.ProgramFlags
ProgramFlags = ProgramFlags OR COUNTDOWN
MsgBox “Flag for ” & strTSID & ” currently set to ” & OldProgramFlags & ” (HEX: 0x” & HEX(OldProgramFlags) & “)” & vbCrLF & vbCrLF & “Adding 0x00000400 (COUNTDOWN. The countdown dialog is not displayed)” & VBCrLF & vbCrLF & “Set flag to: ” & ProgramFlags & ” (HEX: 0x” & HEX(ProgramFlags) & “)”,,”SUCCESS!”
‘ see ConfigMgr SDK for details (“SMS_Program Server WMI Class”)
objProgram.ProgramFlags = ProgramFlags
objProgram.Put_
2. Run the VBscript. You’ll be prompted with a list of the Task Sequences. Type in the name of the task sequence you want to change (e.g. NYC000279) and hit OK.
3. You should see a response like the following:
—————————
SUCCESS!
—————————
Flag for NYC00279 currently set to 152084496 (HEX: 0x910A010)Adding 0x00000400 (COUNTDOWN. The countdown dialog is not displayed)
Set flag to: 152085520 (HEX: 0x910A410)
—————————
OK
—————————
4. Then advertise the Task Sequence and the Task Sequence will not popup any messages on the client workstation.
5. NOTE: This version is improved in that it prompts you for the task sequence ID and also now “OR’s” the value together rather than just blindly adding 1024 to the value every time the script runs, so you can safely run this script multiple times without any issues on the same Task Sequence.
References:
Workaround to disable notification for task sequence?
Notifications for virtual packages
Excellent post – thank you for taking the time to provide this information.
Hi! For some reason, the list with task sequences that is returned to me doesn´t seem entirly correct. It looks random in a way and there are a lot of TS:s missing. How come?
Ah, sorry…now I understand. You can simply just type in the ID of the specific TS and the script will work even though the ID is not in the list returned…
This script does not work for me. When I try to run it, I get:
Line: 1
Char: 1
Error: Invalid Character
Code: 800A0408
Source: Microsoft VBScript compilation error
Take a look at the single and double quotes. I’ve found that a lot of scripts from the web replace the vertical single (‘) and double quotes (“) with the fancy curved quotes. Considering that line 1 character 1 is a single quote that’s probably the issue.
I got past the initial errors for the quotes. But now I’m stuck at Line 25, Char: 1 Error: Generic Failure.
Any Ideas?
Oh wait, is there anyway to disable the advertisements popups?
Were you able to get around the error message? Considering it was character 1 I would have thought it might have copied the apostrophe incorrectly, but line 25 in the script doesn’t start with an apostrophe. What is the text of the line 25 for you?
I had to replace all my single and double quotes and it worked fine. Thanks! This helps us out tremendously.
In 2012 R2 do you need to re-deploy it to have them go away?
Thanks.
I had a need to reenable a task sequence notification, so for anyone else that finds themselves in this situation just edit the above script and replace the line “ProgramFlags = ProgramFlags OR COUNTDOWN” with “ProgramFlags = ProgramFlags – (ProgramFlags AND COUNTDOWN)”
As with the revised version above, this can also be run multiple times with no harm (it only removes it if it is already set)
I also adjusted the msgbox text on the next line to say “Removing” instead of “Adding” and “is displayed” instead of “not displayed” so that I didn’t confuse myself.
I get the same error Wendell reported, but no indication he got past the error. I verified there are no formatting issues with double or single quotes.
Error I get: Line 25, Char: 1 Error: Generic Failure.