Script to fix issues with sending of attachments from Exchange to Notes (KB924240)

This script fix the issue reported on;en-us;924240

It’s a powershell script that modify all mail users (not mailbox users) from the search base that you specify, setting mAPIRecipient as FALSE. It’s based on a generic script to do AD modifications, found at

# Modify Search root:
$SearchRoot = "dc=use3,dc=local"

# Filter by mail users, that is: class = user,
# Exchange alias set and HomeServer no set
$Filter = "(&(objectClass=user)(!msExchHomeServerName=*)(mailNickname=*))"

$Scope = "subtree"

# mAPIRecipent = FALSE, No winmail.dat will be sent to mail users.

$Attribute = "mAPIRecipient"
$Value = "FALSE"

$Searcher = new-object DirectoryServices.DirectorySearcher
$Root = [ADSI]("LDAP://" + $SearchRoot)

$Searcher.SearchScope = $Scope
$Searcher.Filter = $Filter
$Searcher.SearchRoot = $Root

$UserList = $Searcher.FindAll()

foreach($User in $UserList)
  write-host $User.Path
  $UserADSI = [ADSI]$User.Path
  $CurrentValue = $UserADSI.Get($Attribute)
  write-host "Current Value is" $CurrentValue -ForeGroundColor White
  $Put = $UserADSI.Put($Attribute,$Value)
  $Set = $UserADSI.SetInfo()
  write-host "New value is" $UserADSI.Get($Attribute)