The input object cannot be bound to any parameters for the command either because the command does

Copper Contributor

Hi guys,

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?



[Parameter(Position=0, Mandatory=$true)]
[Parameter(Position=1, Mandatory=$true)]
[Parameter(Position=2, Mandatory=$true)]

function New-AuditLogReport {
        [Parameter(Position=0, Mandatory=$true, ValueFromPipeline=$true)]
	begin {
$css = @'
	<style type="text/css">
	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;
		$sb = New-Object System.Text.StringBuilder
		[void]$sb.AppendLine("<table cellspacing='0'>")
		[void]$sb.AppendLine("<tr><td colspan='6'><strong>Hosted Exchange 2019 Administrator Audit Log Report for $((get-date).ToShortDateString())</strong></td></tr>")
		[void]$sb.AppendLine("<td><strong>Run Date</strong></td>")
		[void]$sb.AppendLine("<td><strong>Object Modified</strong></td>")
	process {
		$cmdletparameters += $AuditLogEntry.cmdletparameters | %{
			"$($ : $($_.value)<br>"
		$cmdletparameters = $null
	end {
		Write-Output $sb.ToString()

Send-MailMessage -To $To `
-From $From `
-Subject "Exchange Audit Log Report for $((get-date).ToShortDateString())" `
-Body (Search-AdminAuditLog -ResultSize 250000 -StartDate ((Get-Date).AddHours(-1)) -EndDate (Get-Date) | New-AuditLogReport) `
-SmtpServer $SmtpServer `



This server the "TypeName" is correct and the script is working fine.


Search-AdminAuditLog -ResultSize 250000 -StartDate ((Get-Date).AddHours(-1)) -EndDate (Get-Date) |
Get-Member | ForEach-Object TypeName | Select-Object -Unique



Another Exchange server is different: <Deserialized.*>

Search-AdminAuditLog -ResultSize 250000 -StartDate ((Get-Date).AddHours(-1)) -EndDate (Get-Date) |
Get-Member | ForEach-Object TypeName | Select-Object -Unique


How can I serialize again this AdminAuditLogEvent class Powershell?



3 Replies
Anyone? This thread is dead?

if I load Exchange assemblies, I'm able to use the BinaryFormatter to deserialize or serialize to Exchange native objects?

This server the "TypeName" was correct and the script is worked fine, now after to apply SU11 of November, now broken my script, how to se to "Microsoft.Exchange.Management.SystemConfigurationTasks.AdminAuditLogEvent" again?


Search-AdminAuditLog -ResultSize 250000 -StartDate ((Get-Date).AddHours(-1)) -EndDate (Get-Date) |
Get-Member | ForEach-Object TypeName | Select-Object -Unique






Update, I opened a case in microsoft support professional and the problem is not solved. They don't know what it is.




After to apply update.