none
Workaround to disable notification for task sequence? RRS feed

  • Question

  • Hello,

    Has anyone come up with a method that will allow me to deploy an unassigned (non-mandatory) task sequence without popping the notification balloon? I want to keep a persistent advert for all systems but I don't want to notify everyone about its arrival.

     

    In future versions it would be great if we could control that like we can on programs, but for now I'd be ok with just about any work around! Smile

     

    Thanks,

    Ben

    Tuesday, November 25, 2008 8:48 PM

Answers

  • Ive managed to get this working using the script mentioned above as a guide.  You need to query 'SMS_TaskSequencePackage' rather than 'SMS_Program'.  Here is the script I used, half created from WMI Code Creator and half taken from the example above:

    strComputer = "."
    Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\SMS\site_ABC")
    Set colItems = objWMIService.ExecQuery( _
        "SELECT * FROM SMS_TaskSequencePackage",,48)
    For Each objItem in colItems
        If objItem.PackageID = "ABC00001" Then
            Wscript.Echo "-----------------------------------"
            Wscript.Echo "SMS_TaskSequencePackage instance"
            Wscript.Echo "-----------------------------------"
            Wscript.Echo "Name: " & objItem.Name
            Wscript.Echo "PackageID: " & objItem.PackageID
            Wscript.Echo "ProgramFlags: " & objItem.ProgramFlags

            ProgramFlags = objItem.ProgramFlags
            WScript.Echo "Flags for " & objItem.PackageID & ":" & objItem.Name & " 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
            objItem.ProgramFlags = ProgramFlags
            objItem.Put_
        End If
    Next

    Be sure to change the site code and package id in the script.

    Hope this helps.

    Sunday, January 11, 2009 9:47 PM

All replies

  • Instead of using a TS just use an standard Advertisment and set the package to "suppress" notification.

     

    Wednesday, November 26, 2008 3:22 AM
    Moderator
  • Sorry, I should have clarified that I need to use a task sequence in order to leverage the 'Request State Store' task in a task sequence for site awareness as well as some other technical aspects unique to my implementation.

     

    Thanks,

    Ben

    Wednesday, November 26, 2008 3:41 AM
  • I haven't tried my script with tasksequences, but I guess that I should work for them, too: http://mssmsfaq.spaces.live.com/blog/cns!ED21429C2C20B1B2!547.entry. It's in German but you can figure out the technical details ;-) Keep in mind that the program name for a tasksequence is *. So you should change

    strProgramName = "[Virtual application]" to

    strProgramName = "*" (and strPackageID to your TS ID,too)

    Let me know if it worked for you!
    Wednesday, November 26, 2008 9:19 AM
    Moderator
  • Great, thanks! I think we are on the right track.

     

    I'm having issues getting the script to run though. For some reason it fails on the last line with a Generic Failure.

     

    If I manually update the database with the value presented in the msgbox I do not get the desired result, so I'm assuming some other cool 'magic' happens within the wbem call..?

     

    I'm going to keep toying around with it.

     

    Thanks!
    Ben

    Wednesday, November 26, 2008 5:22 PM
  • I'll have a look at this when there's time ...

     

    Wednesday, November 26, 2008 6:13 PM
    Moderator
  • Anyone had any success with this?

     

    Need to disable notification for a specific application task sequence... we are caching the task sequence contents and want the ts advertisement to be always available in "Run programs"... but do not want a popup notification at all.

     

    The programs that are referenced within the TS are all set to "suppress program notifications".

     

    Do not want to disable notifications site wide.

    Thursday, December 11, 2008 2:48 AM
  • Ive managed to get this working using the script mentioned above as a guide.  You need to query 'SMS_TaskSequencePackage' rather than 'SMS_Program'.  Here is the script I used, half created from WMI Code Creator and half taken from the example above:

    strComputer = "."
    Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\SMS\site_ABC")
    Set colItems = objWMIService.ExecQuery( _
        "SELECT * FROM SMS_TaskSequencePackage",,48)
    For Each objItem in colItems
        If objItem.PackageID = "ABC00001" Then
            Wscript.Echo "-----------------------------------"
            Wscript.Echo "SMS_TaskSequencePackage instance"
            Wscript.Echo "-----------------------------------"
            Wscript.Echo "Name: " & objItem.Name
            Wscript.Echo "PackageID: " & objItem.PackageID
            Wscript.Echo "ProgramFlags: " & objItem.ProgramFlags

            ProgramFlags = objItem.ProgramFlags
            WScript.Echo "Flags for " & objItem.PackageID & ":" & objItem.Name & " 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
            objItem.ProgramFlags = ProgramFlags
            objItem.Put_
        End If
    Next

    Be sure to change the site code and package id in the script.

    Hope this helps.

    Sunday, January 11, 2009 9:47 PM
  • Yes, that's the way to disable / edit the notifications for tasksequences. Well done!

    I've rewritten my piece of code and now it looks like this:

    strSMSServer = "." 
    strTSID = "ABC00001" 
     
    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)  
        End If 
    Next   
     
    Set objProgram = objSCCM.Get("SMS_TaskSequencePackage.PackageID='" & strTSID & "'")   
     
    ProgramFlags = objProgram.ProgramFlags  
    WScript.Echo "Flag for " & strTSID & " 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_ 

    Yours is working, too.
    Monday, January 12, 2009 12:35 PM
    Moderator
  •  Will that script run and suppress all os packages and task sequences? Can we edit it such that it will?

    Does this have to be run for every task sequence?  So if we create a new one we have to keep going in and running this thing?
    Thursday, January 22, 2009 3:03 PM
  • That script is nothing more than a "proof of concept". It's not ready for production at all (no error handling, does not check if the flag is already set, ... ) ;-) and it does only change the ProgramFlags for one single task sequence. It could be easiliy modified to change all of them.

    You cannot suppress "os packages" (but the task sequence that are used to advertise an OS package).

    You have to set the ProgramFlags of every newly created task sequence (by running the script).
    Thursday, January 22, 2009 3:21 PM
    Moderator
  • I seem to recall having to do something similar in SMS 2003 for os pushes.

    I guess my question is,

    Do either of these scripts change the flag on ALL task sequences or can it be changed such that it does a search for all task sequences and changes the flag.

    Also if you do the add that way, does it matter if it's already set?

     

    I was thinking it would be nice to set it up so that we can safely just run the script without having to enter in the packageid..

     

    That is what StrTsid is in the last script right?

    Thursday, January 22, 2009 3:54 PM
  • I'm also wondering if we could simply..



    make the change in binary rather than decimal.

    Example instead of ProgramFlags = ProgramFlags + 1024

    ProgramFlags = ProgramFlags OR 10000000000
    Thursday, January 22, 2009 4:16 PM
  • dynas2001 said:

    Do either of these scripts change the flag on ALL task sequences or can it be changed such that it does a search for all task sequences and changes the flag. 


    David's script is ennumerating all task sequences and will only change the flags if the PackageID (IOW: task sequence ID) matches a given ID ("ABC00001" in the example above). My version will only change a specific TS (strTSID). So David's version can easily be modified that all TS will be changed. You have to add some logic so that it does not add +1024 to the flags again when running a second time!
    I don't know if "ProgramFlags = ProgramFlags OR 10000000000" would also work. That's something that has to be tested in a lab!
    Thursday, January 22, 2009 8:25 PM
    Moderator
  • Hello Ben

    You could disable all balloon tips via Group Policy's.

     

    1. Navigate to User Configuration > Administrative Templates > Start Menu & Taskbar

    2. Double-click Remove Balloon Tips on Start Menu Items and select Enabled

    /Svenbjørn
    Friday, July 2, 2010 12:40 PM
  • You could disable all balloon tips via Group Policy's.
    That's true, but it will - as you already stated - disable ALL balloon tips, which might not be desired.
    Friday, July 2, 2010 12:46 PM
    Moderator
  • Where do I find this setting in CCM namespace?

     

     


    Mayur
    Thursday, October 20, 2011 9:18 PM
  • Please never mind. I thought the script was for client WMI. I got it to work on the server. Although it will ge good to know if it's possible to change it on the client side if you dont want to disable is for the everyone.


    Mayur
    Thursday, October 20, 2011 10:00 PM