Kaseya Community

Outlook Junk Email Filtering

  • Looking for a method to disable Outlook Junk Email Filtering outside of GPO.

    Difficulties doing it via Registry because MAPI profiles can assume any name.

    Anyone have a VBS or any assistance? The code below does not work.

    Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\defaultTongue TiedtdRegProv")
    iValues = Array(&Hff,&Hff,&Hff,&Hff)
    BinaryValueName = "0003041b"
    strKeyPath2 = "Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\Outlook\0a0d020000000000c000000000000046"
    strKeyPath4 = "Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles"
    oReg.EnumKey HKEY_CURRENT_USER, strKeyPath4, arrSubKeys

    For Each subkey In arrSubkeys
    If subkey = "Outlook" Then
    oReg.SetBinaryValue HKEY_CURRENT_USER, strKeyPath2, BinaryValueName, iValues
    End If

    Legacy Forum Name: Outlook Junk Email Filtering,
    Legacy Posted By Username: nevesis
  • I found a page in a book that describes a reg key to turn off junk mail filtering in Outlook 2003. The book details are at

    The specifics are:

    Dword value:
    Keyname; JunkMailProtection
    Value; 4294967295

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: dbennett
  • Thank you for the help. It pointed me in the right direction. The settings I am using are:

    HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Outlook\Options\Mail for Outlook 2007

    "JunkMailProtection"=dword:ffffffff (or decimal 4294967295)


    HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Outlook\Options\Mail for Outlook 2003.

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: nevesis
  • I'm looking for something similar but don't necessarily want to turn off Junk Email completely but I want to just make it so our domain doesn't go to junk email on all our clients. We have around 400 computers on Kaseya and sometimes our ticket emails or emails in general go into junk email. Is there a script we can make that will just make it so our domain doesn't put emails into junk email.

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: mdntblu
  • This can be accomplished a bit more elegantly. Instead of counting on a user to be logged in, we can search through the registry for a particular registry value and change it for all profiles. Then it can simply be run on demand from Kaseya. Here is a VBS script I used to enable cached mode in this manner:

    ' Original code written by Bill James (wgjames@mvps.org)
    ' http://www.billsway.com/vbspage/ShowScript.asp?tgt=txtfiles/RegSrch.txt
    ' Heavily modified by Steve Mason (smason@endsight.net) on July 13, 2010.
    ' Searches and modifies the registry to enable Cached Mode for all Outlook profiles.
    ' Designed to run silently as a logon script via Group Policy.

    On Error Resume Next

    Dim oWS : Set oWS = CreateObject("WScript.Shell")
    Dim oFSO : Set oFSO = CreateObject("Scripting.FileSystemObject")

    Dim sSearchFor
    sSearchFor = "00036601"

    Dim sRegTmp, sOutTmp, eRegLine, iCnt, sRegKey, aRegFileLines

    sRegTmp = oWS.Environment("Process")("Temp") & "\RegTmp.tmp "
    sOutTmp = oWS.Environment("Process")("Temp") & "\sOutTmp"

    oWS.Run "regedit /e /a " & sRegTmp & chr(34) & "HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles" & chr(34), , True

    With oFSO.OpenTextFile(sOutTmp, 8, True)

    With oFSO.GetFile(sRegTmp)
    aRegFileLines = Split(.OpenAsTextStream(1, 0).Read(.Size), vbcrlf)
    End With


    For Each eRegLine in aRegFileLines
    If InStr(1, eRegLine, "[", 1) > 0 Then sRegKey = eRegLine
    If InStr(1, eRegLine, sSearchFor, 1) > 0 Then
    If sRegKey <> eRegLine Then
    .WriteLine(vbcrlf & sRegKey) & vbcrlf & chr(34) & "00036601" & chr(34) & "=hex:84,01,00,00"
    .WriteLine(vbcrlf & sRegKey)
    End If
    iCnt = iCnt + 1
    End If

    Erase aRegFileLines

    If iCnt
    End If

    End With

    oWS.Run "regedit /s " & sOutTmp, , True


    Sub Cleanup()
    Set oWS = Nothing
    Set oFSO = Nothing
    End Sub

    You'll want to change lines 16 and 38 to reflect the change you wish to make. Enjoy.

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: SMason
  • Another thing I should point out is the starting point for the search (line 23). We can bump it up to the root of the registry to search all Windows profiles as well. The search will just take longer.

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: SMason
  • Hey!

    Didn't found any "update" Thread like that. Has anyone a "up 2 date" procedure for Outlook 2007-2013 on Windows-Machines?

  • Procedure Kill Junk Email Settings.xml

    Here's the one I use. Pretty simple. You would have to change the "14" to "15" for Outlook 2013, I think.