Get-MailboxStatistics -Server with -Archive doesn't work for me

I must be doing something wrong but here is my issue:

 

Get-MailboxStatistics -Server "exnameofserver"  #works fine and returns data

Get-MailboxStatistics -Server "exnameofserver" -Archive   #throws this error: "Parameter set cannot be resolved using the specified named parameters"

Same issue with -Database param btw

I know I can run a foreach with Identity but that will take 5 hours on the archives when the primarys data returns in a matter of a couple of minutes with all info I need.

Anyone know what I am doing wrong or a better way than foreach and 5 hours???

 

  • Check out the help for Get-MailboxStatistics.  You'll find that you can't use -Server and -Archive together (that's what the Parameter Set error means).

  • Try using Get-Mailbox and pipe that to Get-MailboxStatistics:

    Get-Mailbox -Server "EX01" | Get-MailboxStatistics -Archive

    OR

    Get-Mailbox -Database "DB01" | Get-MailboxStatistics -Archive

     

  • Martin:

    If someone does not know how to read help properly, you post doesn't help, so to clarify for me and others reading...

    You mean looking at the SYNTAX part of the help where it shows -Database and -Server without the -Archive switch?

    Thanx. I missed that.  :)

  • Bill Nunley said:
    If someone does not know how to read help properly, you post doesn't help, so to clarify for me and others reading

    Bill, let me see if I can help here.

    If you look at the help for Get-MailboxStatistics you will notice there are four ways to invoke the same cmdlet.  These are based on the parameters sent into the cmdlet.  Here we have four different parameter sets.  The cmdlet decides what to do based on the parameters sent into it.  You cannot mix and match parameters across parameter sets.

    If you look at all four, you will notice that no parameter set has both the -Archive and -Server parameters in the same parameter set.  At that point PS decided it was confused because it didn't know which set to use and which subsequent operations to perform.  So it kicked out the "Parameter set cannot be resolved using the specified named parameters" error and gave up.

  • Bob:

     

    Yep, that's what I saw also. Just didn't understand why. Seems like the command should just as easily pull -Archive for -Server if it can pull Primary info. 

  • Peter Jurgens said:

    Try using Get-Mailbox and pipe that to Get-MailboxStatistics:

    Get-Mailbox -Server "EX01" | Get-MailboxStatistics -Archive

    OR

    Get-Mailbox -Database "DB01" | Get-MailboxStatistics -Archive

     

     

    Peter... you da MAN! This process pulled all the info in 25 minutes!

     

    Thank you very much for the help.

     

    Bill

     

  • Hey Bill, sorry I wasn't more explicit.  I was on an iPad so that makes things harder, and I've been yelled at for being TO explicit too!  So I assumed you would know what I meant, by default!  No disrespect meant at all!

  • Martin 9700 said:

    Hey Bill, sorry I wasn't more explicit.  I was on an iPad so that makes things harder, and I've been yelled at for being TO explicit too!  So I assumed you would know what I meant, by default!  No disrespect meant at all!

     

    None taken at all or meant on my side. I do appreciate the reply.

     

    Cheers!

    Bill