Method #1.
If the Mail app is deployed with the following command:
$Mbx = get-mailbox "mailbox"
New-App -mailbox $Mbx.LegacyExchangeDN -Url `
("https://EV_server.domain.com/EnterpriseVault/OfficeMailAppManifest.aspx?LegacyMbxDn=" +
[System.Web.HttpUtility]::UrlEncode($Mbx.LegacyExchangeDN))
The following error occurs:
The app couldn't be downloaded.
+ CategoryInfo : InvalidData: (:) [New-App], LocalizedException
+ FullyQualifiedErrorId : [Server=EX1,RequestId=e61f89f6-f16b-4f07-b9e1-9ba9b6beedb6,TimeStamp=7/14/2022 10:05:33
PM] [FailureCategory=Cmdlet-LocalizedException] 3E374F34,Microsoft.Exchange.Management.Extension.NewApp
Method #2
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: An unexpected error
occurred on a send."
At line:1 char:1
+ $bytes = $webclient.DownloadData($uri); New-App -mailbox $Mbx.LegacyE ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : WebException
The EV server used in the commands requires TLS 1.2, and the exchange server powershell / .NET version does not support TLS 1.2, by default.
Use Method #2 above, but first run the following line to enable TLS 1.2:
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
The app couldn't be downloaded.
+ CategoryInfo : InvalidData: (:) [New-App], LocalizedException
+ FullyQualifiedErrorId : [Server=EX1,RequestId=e61f89f6-f16b-4f07-b9e1-9ba9b6beedb6,TimeStamp=7/14/2022 10:05:33
PM] [FailureCategory=Cmdlet-LocalizedException] 3E374F34,Microsoft.Exchange.Management.Extension.NewApp
Method #2
If the mail app is deployed with the following commands:
Add-Type -AssemblyName System.WebWrite-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