title: The input object cannot be bound to any parameters for the command either because the command does not take pipeline input
body: <p>I've always run the script below since exchange server 2013 and after applying the exchange server 2019 CU11 and exchange server 2016 CU22 updates I've been getting the error below. I tried in various ways to get around and was not successful in getting around this situation. Can someone help me please?</p>
  <p>My error:</p>
  <pre class="lang-none prettyprint-override"><code>[PS] D:\AuditLogReport&gt;.\AuditLogReport.ps1 -To e-mailo@domain.com -From auditlogreport@domain.com -SmtpServer SRV001.myomain.local
  New-AuditLogReport : The input object cannot be bound to any parameters for the command either because the command
  does not take pipeline input or the input and its properties do not match any of the parameters that take pipeline
  input.
  At D:\AuditLogReport\AuditLogReport.ps1:72 char:107
  + ... ((Get-Date).AddHours(-1)) -EndDate (Get-Date) | New-AuditLogReport) `
  +                                                     ~~~~~~~~~~~~~~~~~~
      + CategoryInfo          : InvalidArgument: (Microsoft.Excha...inAuditLogEvent:PSObject) [New-AuditLogReport], Para
     meterBindingException
      + FullyQualifiedErrorId : InputObjectNotBound,New-AuditLogReport
  </code></pre>
  <p><a href="https://i.stack.imgur.com/GzaT1.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GzaT1.png" alt="enter image description here" /></a></p>
  <pre><code>param(
  [Parameter(Position=0, Mandatory=$true)]
  $To,
  [Parameter(Position=1, Mandatory=$true)]
  $From,
  [Parameter(Position=2, Mandatory=$true)]
  $SmtpServer
  )
  
  function New-AuditLogReport {
      [CmdletBinding()]
      param(
          [Parameter(Position=0, Mandatory=$true, ValueFromPipeline=$true)]
          [Microsoft.Exchange.Management.SystemConfigurationTasks.AdminAuditLogEvent]
          $AuditLogEntry  
          )
      begin {
  $css = @'
      &lt;style type=&quot;text/css&quot;&gt;
      body { font-family: Tahoma, Geneva, Verdana, sans-serif;}
      table {border-collapse: separate; background-color: #F2F2F2; border: 3px solid #103E69; caption-side: bottom;}
      td { border:1px solid #103E69; margin: 3px; padding: 3px; vertical-align: top; background: #F2F2F2; color: #000;font-size: 12px;}
      thead th {background: #903; color:#fefdcf; text-align: left; font-weight: bold; padding: 3px;border: 1px solid #990033;}
      th {border:1px solid #CC9933; padding: 3px;}
      tbody th:hover {background-color: #fefdcf;}
      th a:link, th a:visited {color:#903; font-weight: normal; text-decoration: none; border-bottom:1px dotted #c93;}
      caption {background: #903; color:#fcee9e; padding: 4px 0; text-align: center; width: 40%; font-weight: bold;}
      tbody td a:link {color: #903;}
      tbody td a:visited {color:#633;}
      tbody td a:hover {color:#000; text-decoration: none;
      }
      &lt;/style&gt;
  '@  
          $sb = New-Object System.Text.StringBuilder
          [void]$sb.AppendLine($css)
          [void]$sb.AppendLine(&quot;&lt;table cellspacing='0'&gt;&quot;)
          [void]$sb.AppendLine(&quot;&lt;tr&gt;&lt;td colspan='6'&gt;&lt;strong&gt;Hosted Exchange 2019 Administrator Audit Log Report for $((get-date).ToShortDateString())&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;&quot;)
          [void]$sb.AppendLine(&quot;&lt;tr&gt;&quot;)
          [void]$sb.AppendLine(&quot;&lt;td&gt;&lt;strong&gt;Caller&lt;/strong&gt;&lt;/td&gt;&quot;)
          [void]$sb.AppendLine(&quot;&lt;td&gt;&lt;strong&gt;Run Date&lt;/strong&gt;&lt;/td&gt;&quot;)
          [void]$sb.AppendLine(&quot;&lt;td&gt;&lt;strong&gt;Succeeded&lt;/strong&gt;&lt;/td&gt;&quot;)
          [void]$sb.AppendLine(&quot;&lt;td&gt;&lt;strong&gt;Cmdlet&lt;/strong&gt;&lt;/td&gt;&quot;)
          [void]$sb.AppendLine(&quot;&lt;td&gt;&lt;strong&gt;Parameters&lt;/strong&gt;&lt;/td&gt;&quot;)
          [void]$sb.AppendLine(&quot;&lt;td&gt;&lt;strong&gt;Object Modified&lt;/strong&gt;&lt;/td&gt;&quot;)
          [void]$sb.AppendLine(&quot;&lt;/tr&gt;&quot;)
      }
      
      process {
          [void]$sb.AppendLine(&quot;&lt;tr&gt;&quot;)
          [void]$sb.AppendLine(&quot;&lt;td&gt;$($AuditLogEntry.Caller.split(&quot;/&quot;)[-1])&lt;/td&gt;&quot;)
          [void]$sb.AppendLine(&quot;&lt;td&gt;$($AuditLogEntry.RunDate.ToString())&lt;/td&gt;&quot;)
          [void]$sb.AppendLine(&quot;&lt;td&gt;$($AuditLogEntry.Succeeded)&lt;/td&gt;&quot;)
          [void]$sb.AppendLine(&quot;&lt;td&gt;$($AuditLogEntry.cmdletname)&lt;/td&gt;&quot;)
          $cmdletparameters += $AuditLogEntry.cmdletparameters | %{
              &quot;$($_.name) : $($_.value)&lt;br&gt;&quot;
          }
          [void]$sb.AppendLine(&quot;&lt;td&gt;$cmdletparameters&lt;/td&gt;&quot;)
          [void]$sb.AppendLine(&quot;&lt;td&gt;$($AuditLogEntry.ObjectModified)&lt;/td&gt;&quot;)
          [void]$sb.AppendLine(&quot;&lt;/tr&gt;&quot;)
          $cmdletparameters = $null
      }
      
      end {
          [void]$sb.AppendLine(&quot;&lt;/table&gt;&quot;)
          Write-Output $sb.ToString()
      }
  }
  
  Send-MailMessage -To $To `
  -From $From `
  -Subject &quot;Exchange Audit Log Report for $((get-date).ToShortDateString())&quot; `
  -Body (Search-AdminAuditLog -ResultSize 250000 -StartDate ((Get-Date).AddHours(-48)) -EndDate (Get-Date) | New-AuditLogReport) `
  -SmtpServer $SmtpServer `
  -BodyAsHtml
  </code></pre>