Solved

How do I sign a script so Outlook will run it without querying it.

Posted on 2002-04-05
5
280 Views
Last Modified: 2008-03-17
Hi.

I've got a VBS script (below).

When I run it, Outlook XP says that there is another program running, sending email on my behalf.

What I want to do is :

1 - Get a digitial signature.
2 - Sign the script so that Outlook knows that it is from me.
3 - In the script, check that I will be allowed to send email.
4 - Tell Outlook only to allow signed/trusted scripts.

The script is ...

' AVUpdate.VBS (C) UK 2002 Carval Computing Ltd
' Author Richard Quadling
' Date Friday, 5 April 2002 12:37 12:37:53 PM
'
' This script is to be launched during the McAfee AntiVirus Update routines as follows.

' Define the necessary variables and objects.
Dim CurrentVersion, SDATFileName, FileSystem, CurrentFile, CurrentStream, INILine, OutlookApp, OutlookMailItem

' Create the FileSystem, Files and TextStreams Objects.
Set FileSystem = CreateObject("Scripting.FileSystemObject")
Set CurrentFile = FileSystem.GetFile("Updates (SDAT program for ALL platforms)\DELTA.INI")
Set CurrentStream = CurrentFile.OpenAsTextStream(1, 0)

' Get the CurrentVersion
With CurrentStream
    Do
        INILine = .ReadLine
    Loop While INILine <> "[Contents]"
    Do
        INILine = .ReadLine
        If Left(INILine, 15) = "CurrentVersion=" Then
            CurrentVersion = Right(INILine, 4)
        End If
    Loop While Mid(INILine, 1, 1) <> "["
End With

' Build the SDATFilename
SDATFileName = "V:\Updates (SDAT program for ALL platforms)\SDAT" & CurrentVersion & ".EXE"

' Does the SDAT file does exist.
With FileSystem
      if .FileExists(SDATFileName) = False Then
' Preserve the local SuperDAT.LOG file
            .MoveFile "Updates (SDAT program for ALL platforms)\SuperDAT.log", ".\"

' Copy everything to V:\Updates (SDAT program for ALL platforms).
            .CopyFile "Updates (SDAT program for ALL platforms)\*.*", "V:\Updates (SDAT program for ALL platforms)", True

' Restore the local SuperDAT.LOG file
            .MoveFile "SuperDAT.log", "Updates (SDAT program for ALL platforms)\"
      End If

' Check to see if the SDAT file does exist.
      If .FileExists(SDATFileName)  Then

' Copy the current SuperDat.log file as SuperDat CurrentVersion CCYYMMDD.log
            If .FileExists("V:\Updates (SDAT program for ALL platforms)\SuperDat.log") Then
                  .MoveFile "V:\Updates (SDAT program for ALL platforms)\SuperDat.log", "V:\Updates (SDAT program for ALL platforms)\SuperDat" + CurrentVersion + " " + Format(Date, "YYYYMMDD") + ".log"
            End If

' Email everyone about the new file.
      Set OutlookApp = CreateObject("Outlook.Application")
      Set OutlookMailItem = OutlookApp.CreateItem(olMailItem)
        With OutlookMailItem
                  .Subject = "McAfee AntiVirus Update V4.0." + CurrentVersion
                  .To = "Alan Cannon;Chris Sweby;Clive Caunter;Jeff Bowes;Jo Albon;John Cannon;Lisa Collins;Nicola Taylor;Richard Quadling"
                  .HTMLBody = _
                        "<html>" + Chr(13) + _
                        "<body>" + Chr(13) + _
                        "<div align=""center""><h1><b>McAfee AntiVirus Update V4.0." + CurrentVersion + "</b></h1></div><br>" + Chr(13) + _
                        "<div><b>If you are reading this email, then make sure that the little shield in the system tray next to the clock has a sword over the top of it. If not, then your system may not be protecting you against email based viruses!!!!</b></div><br>" + Chr(13) + _
                        "<div>The latest McAfee AntiVirus update can be ran by clicking <a href=""file://\\Carvalnt\AntiVirus\Updates (SDAT program for ALL platforms)\sdat" + CurrentVersion + ".exe"" alt=""McAfee AntiVirus Update Version V4.0." + CurrentVersion + """>here</a>.</div><br>" + Chr(13) + _
                        "<div>When you click the link, you will see a window called ""<tt>Opening Mail Attachment</tt>""<div><br>" + Chr(13) + _
                        "<div>Check that you are opening ...</div><br>" + Chr(13) + _
                        "<div><tt>sdat" + CurrentVersion + ".exe</tt> from <tt>\\Carvalnt\AntiVirus\Updates (SDAT Program for ALL platforms)\</tt><div><br>" + Chr(13) + _
                        "<div>You need to select the ""<tt>Open it</tt>"" option and the click on ""<tt>OK</tt>"".</div><br>" + Chr(13) + _
                        "<div>You must now follow whatever instructions given to you by the updater.</div><br>" + Chr(13) + _
                        "<div>You <b>MUST</b> reboot if you are told to do so.</div><br>" + Chr(13) + _
                        "<div>Our servers are all on automatic updates and are currently running this release.<div><br>" + Chr(13) + _
                        "<div>The Support pc will check to see if an update is necessary every time the pc is turned on. Please be patient with this pc as it only has 24MB of memory and the booting and checking process will take some time.</div><br>" + Chr(13) + _
                        "<br>" + Chr(13) + _
                        "<div>Richard.</div><br>" + Chr(13) + _
                        "</body></html>"
                  .Send
            End With
      End If
End With

0
Comment
Question by:Richard Quadling
  • 3
  • 2
5 Comments
 
LVL 40

Author Comment

by:Richard Quadling
ID: 6920531
This script is saved as a .VBS file and is ran when my local machine has a new virus update (which happens automatically).

Regards,

Richard Quadling.
0
 
LVL 16

Expert Comment

by:Neo_mvps
ID: 6921513
Welcome to the enhance email security update -- who some like to call "hell".


here is the bad news... signing the script will not do anything about that prompt.  your options are the following.

1) you connect to a microsoft exchange or hp openmail system. ask the administrator to implement the admintrative features of this enhancement.  good information on it can be found at:

http://www.slipstick.com/outlook/esecup.htm
http://www.slipstick.com/outlook/esecup/admin.htm

2) redo your solution using c/c++ (or delphi) and extended mapi.

3) use a 3rd party tool called redemption that allows any com based development language to use the outlook object model w/out incuring the security dialogs

http://www.dimastr.com

0
 
LVL 16

Expert Comment

by:Neo_mvps
ID: 6921521
oh darn... one more.

4) if your solution is running on windows 2000 or windows xp box, use cdo for windows 2000 to send administrative smtp alerts. (i do this one for symantec's norton antivirus corporate edition)

0
 
LVL 16

Accepted Solution

by:
Neo_mvps earned 300 total points
ID: 6923898
Just so you know that what I am saying about digital certs is true, see http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dn_voices_askgui/html/askgui04022002.asp.  You will find a paragraph that states...

There is no way to circumvent Outlook security features using registry keys, digital certificates, or any other mechanism other than that described in the article above.
0
 
LVL 40

Author Comment

by:Richard Quadling
ID: 6927605
Hi.

I don't want to change the security model as this will mean those stupid VBS auto-attachments can run when I don't want them to.

My VBS is actually launched by the our AV updater on a successful update.

Thanks.

Richard Quadling.
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

MS Outlook is a world-class email client application that is mainly used for e-communication globally.  In this article, we will discuss the basic idea about MS Outlook, its advanced features, and types of MS Outlook File formats.
Many people use more than one email account and so it becomes difficult for them to manage them when they use separate accounts,  so, in this article, I have shared an easy way to add Other Mail Accounts in your Google Inbox. It helps to combine all…
To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
CodeTwo Sync for iCloud (http://www.codetwo.com/sync-for-icloud?sts=6554) automatically synchronizes your Outlook 2016, 2013, 2010 or 2007 folders with iCloud folders available via iCloud Control Panel. This lets you automatically sync them with…

832 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question