techdrive
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
$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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.