Exchange Shell one-liner: Get last night online defrag statistics

Exchange writes an event once the online defragmentation process ends. This one-liner gets events written on the last day:
Get-EventLog -LogName Application | Where-Object { $_.eventID -eq 12
21 -and (New-TimeSpan $_.TimeGenerated $(get-Date)).days -lt 1} | select message

The database "SG1\MBX1" has 0 megabytes of free space after online defragmen...

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)