Avatar of Kelly Garcia
Kelly Garcia
Flag for United Kingdom of Great Britain and Northern Ireland

asked on 

Remote Powershell Issue

HI All,

When I log into the exchange 2010 server and run this code on the exchange management shell, it works fine. However when I remote into the exchange server via powershell I get an error.

Below is the code:

$GMSize = foreach ($m in get-mailbox -ResultSize Unlimited )
				{
					Get-MailboxStatistics $m | where {$_.TotalItemSize -ge "4GB"} | Select-Object @{Name="DisplayName";Expression={Get-Mailbox $m | select -ExpandProperty SamAccountName}}, TotalItemSize, ItemCount, Database, TotalDeletedItemSize,DeletedItemCount, LastLoggedOnUserAccount, LastLogonTime, LastLogoffTime
				}

Open in new window


this is the error I get:

Cannot process argument transformation on parameter 'Identity'. Cannot convert the "Alexandru Gavris" value of type
"Deserialized.Microsoft.Exchange.Data.Directory.Management.Mailbox" to type
"Microsoft.Exchange.Configuration.Tasks.GeneralMailboxOrMailUserIdParameter".
    + CategoryInfo          : InvalidData: (:) [Get-MailboxStatistics], ParameterBindin...mationException
    + FullyQualifiedErrorId : ParameterArgumentTransformationError,Get-MailboxStatistics
    + PSComputerName        : thomsons-mail01.t-bx.com

Open in new window

PowershellExchange

Avatar of undefined
Last Comment
Amit

8/22/2022 - Mon