If the mail app is deployed with the following commands:
Add-Type -AssemblyName System.Web
$Mbx = get-mailbox "mailbox"
$uri = new-object system.uri(
"https://EV_server.domain.com/EnterpriseVault/OfficeMailAppManifest.aspx?LegacyMbxDn=" +
[System.Web.HttpUtility]::UrlEncode($Mbx.LegacyExchangeDN))
$webclient = New-Object Net.Webclient
$webClient.UseDefaultCredentials = $true
try
{
$bytes = $webclient.DownloadData($uri)
New-App -mailbox $Mbx.LegacyExchangeDN -FileData $bytes
}
catch [Net.WebException]
{
[Net.HttpWebResponse] $webResponse = [Net.HttpWebResponse]$_.Exception.Response;
Write-Warning $webResponse.StatusDescription
}
This error happens:
Write-Warning : Cannot bind argument to parameter 'Message' because it is null.
At line:1 char:226
+ ... $_.Exception.Response; Write-Warning $webResponse.StatusDescription;}
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidData: (:) [Write-Warning], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.WriteWarnin
gCommand
If the try/catch block is removed from the above command, the underlying error is revealed:
Exception calling "DownloadData" with "1" argument(s): "The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel."
At line:1 char:1
+ $webclient = New-Object Net.Webclient.UseDefaultCredentials = $true $ ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : WebException
This issue can occur when the certificate installed on the Enterprise Vault server is not trusted by the Exchange server.
Ensure the Certificate Authority (CA cert) that issued the certificate on the Enterprise Vault server is listed in the Trusted Root Certification Authorities list on the Exchange server.