Here's an example of how to identify the AdvertisementID of an advertisement that is currently running on your client.
strComputer = "."
Set objSMS = GetObject("winmgmts://" & strComputer & "/root/ccm/SoftMgmtAgent")
Set colER = objSMS.ExecQuery _
("Select * from CCM_ExecutionRequest")
for each oER in colER
wscript.echo oER.ProgramID & vbTAB & oER.State & vbTAB & _
oER.ProcessID & vbTAB & oER.AdvertID & vbTAB & _
oER.IsAdminContext
next
Also FYI: This functionality is included in SMSView.
I also learned something new today with the reply to the post on myITforum.com for this:
Oh and a short note on the solution for my problem, AdvertID is "" if the user launched the advertisement from ARP but if the advertisement is run as an assignment the value states the AdvertisementID, the property OptionalAdvertisements will however hold the missing information if advertisement was launched from ARP.
Good info!