none
VBScript to create an Advertisement in SMS 2003 with Allow users to run the program independently of assignments as unchecked

    Question

  • Hey Scripting guy,

    I am using the below code for creating an advertisement

                                       

    Set newAdvertisement = objSWbemServices.Get("SMS_Advertisement").SpawnInstance_()
       newAdvertisement.AdvertisementName = strAdvName
           newAdvertisement.comment = "created by CreateAdvert.vbs"       
    newAdvertisement.CollectionID = CollectionID
    newAdvertisement.PackageID = PackageID
    newAdvertisement.ProgramName = ProgramName
    newAdvertisement.PresentTime=datetime
    newAdvertisement.ExpirationTime= expdatetime
    newAdvertisement.ExpirationTimeEnabled=True
    newAdvertisement.ExpirationTimeIsGMT=True
    newAdvertisement.RemoteClientFlags= 128
    newAdvertisement.AdvertFlags=32
    newAdvertisement.Priority=1
    newAdvertisement.Put_

    Everything is fine but I want the "Allow users to run the program independently of assignments" as unchecked. Please change the code so that other fields don't vary and uncheck this field.

    • Moved by Bill_Stewart Thursday, January 02, 2014 7:15 PM Off-topic post
    Thursday, October 24, 2013 9:36 PM

All replies

  • Isn't that this flag:

    http://msdn.microsoft.com/en-us/library/cc146108.aspx

    0x02000000 (25)

    NO_DISPLAY. The user should not run programs independently of the assignment.


    ¯\_(ツ)_/¯

    Thursday, October 24, 2013 10:30 PM
  • The advert flag you are usingisalready set correctly YOu are using decimal 32 which is bit 5

    0x00000020 (5)

    IMMEDIATE. Announce the advertisement to the user immediately.


    ¯\_(ツ)_/¯

    Thursday, October 24, 2013 10:33 PM
  • Hi,

    There are 2 below check boxes in the schedule tab of the Advertisement

    Assignments are not mandatory over slow links

    Allow users to run the program independently of assignments

    I want only Assignments are not mandatory over slow links to be checked and the other one to be unchecked.

    Please advice me on this.

    Wednesday, October 30, 2013 6:02 PM
  • Hi,

    There are 2 below check boxes in the schedule tab of the Advertisement

    Assignments are not mandatory over slow links

    Allow users to run the program independently of assignments

    I want only Assignments are not mandatory over slow links to be checked and the other one to be unchecked.

    Please advice me on this.

    I just did.  Look ,at the flags.  Pick the ones you want.

    Here is the flag for slow link detection: Set it to make assignments mandatory and unset it to make them not mandatory. 

    0x04000000 (26)

    ONSLOWNET. Assignments are mandatory over a slow network connection.

    I think you are getting confused by the fact that the two instructions are reversed.


    ¯\_(ツ)_/¯

    Wednesday, October 30, 2013 8:55 PM