Powershell: Parameter not found (When using invoke-command)

Hello,

I'm trying to run a command (Get-MailboxStatistics) remotely via Powershell. It targets to return every user-mailbox on the exchange server including the size of the mailbox.

When I try to run:

Get-MailboxStatistics -Server exchangeserver | sort TotalItemSize | FT DisplayName, TotalItemSize

Directly on the server in the Exchange Shell it does exactly what I want. 

But as soon as I try this from a remote Computer: 

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://exchangeserver/PowerShell/ -Authentication Kerberos
Import-PSSession $Session -CommandName Get-MailboxStatistics
Get-MailboxStatistics -Server srv02exchange | sort TotalItemSize | FT DisplayName, TotalItemSize
Remove-PSSession $Session


I get the error: 

Es wurde kein Parameter gefunden, der dem Parameternamen "Server" entspricht.
    + CategoryInfo          : InvalidArgument: (:) [Get-MailboxStatistics], ParameterBindingException
    + FullyQualifiedErrorId : NamedParameterNotFound,Get-MailboxStatistics
    + PSComputerName        :  exchangeserver

(No Parameter found, that equals the parameter name "Server".)

The same thing happens when I use Invoke-Command, it doesn't matter if I use a temporary session or import a session.

Any suggestions? 

I'm totally new to the Powershell, maybe it's just something really simple.. 

TIA

July 22nd, 2013 6:53am

Hi Lyrian

Do you have the Exchange Management tools loaded on the remote computer at all?

Have you tried running it with the exchange management shell?

Free Windows Admin Tool Kit Click here and download it now
July 22nd, 2013 1:13pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics