We help IT Professionals succeed at work.
Get Started

Remote Powershell Issue

Kelly Garcia
Kelly Garcia asked
on
281 Views
Last Modified: 2018-02-02
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

Comment
Watch Question
IT Architect
CERTIFIED EXPERT
Distinguished Expert 2017
Commented:
This problem has been solved!
Unlock 1 Answer and 3 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE