Quantcast
Channel: Exchange Server 2013 - Administration, Monitoring, and Performance forum
Viewing all articles
Browse latest Browse all 1453

running a get-mailbox with parameters

$
0
0

I'm starting to learn using Parameters and created a script to get the mailbox of a given server. HOwever when i ran the script i get the error below.  IF i run this as a normal cmdlet without using a parameter like the one below it works though

Get-Mailbox -Filter {servername -eq "servername"} -resultsize unlimited | select Name, Displayname, ServerName, Database

Property ServerName does not support Microsoft.Exchange.Data.ExistsFilter. Only Microsoft.Exchange.Data.ComparisonFilter is supported.
    + CategoryInfo          : NotSpecified: (:) [Get-Mailbox], ADFilterException
    + FullyQualifiedErrorId : [Server=<SERVERNAME>,RequestId=8ea8f425-d9eb-43d4-9e22-ada75fc3c764,TimeStamp=12/12/2019 11:57:22 AM] [FailureCategory=Cmdlet-ADFilterExceptio
   n] 3F164D18,Microsoft.Exchange.Management.RecipientTasks.GetMailbox
    + PSComputerName        : SERVERNAME.xxx.xxx

param([string]$compname)
Get-Mailbox -Filter {servername -eq $compname} -resultsize unlimited | select Name, Displayname, ServerName, Database


PoSH newbie, BaSH Oldie


Viewing all articles
Browse latest Browse all 1453

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>