Link to home
Start Free TrialLog in
Avatar of techdrive
techdriveFlag for United States of America

asked on

Listing only certain exchange mail servers powershell

I am looking for a way to only list a few of our servers rather than all the servers in our environment. I have tried the following . FYI: This is powershell exchange 2007

$serverlist=get-content c:\temp\serverlist.txt
foreach($servers in $serverlist) {
get-exchangeserver $server | get-mailbox | where {$_.prohitibSendQuota -eq [0-9]  } |

format-table -autosize Displayname, TotalItemSize,ItemCount
}

Two things are failing the first is it is erroring out and in addition I am trying to find a value with only a number

Second thing I have tried is this. With this command it is listing all the servers and skipping over what I have in the query. Please help.


get-mailbox -resultsize unlimited | where {$_.servername -eq "server1" -or $_.server -eq  "server2"} | select Alias, servername, ProhibitSendquota

ASKER CERTIFIED SOLUTION
Avatar of Chris Dent
Chris Dent
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial