Link to home
Start Free TrialLog in
Avatar of ARM2009
ARM2009Flag for United States of America

asked on

Sorting data in Exchange powershell to extract the largest value

i have the following script to get the DB's in a DAG

Get-MailboxDatabase -identity EXCHdb* -Status | select ServerName,Name,DatabaseSize,AvailableNewMailboxSpace | Sort-Object AvailableNewMailboxSpace

result is sorted by AvailableNewMailboxSpace ....

need to extract the largest value and grab the name of DB

how do i pipe that ?
Avatar of EEhotline
EEhotline

Try this:

Get-MailboxDatabase -Status | select ServerName,Name,DatabaseSize,AvailableNewMailboxSpace | Sort -property AvailableNewMailboxSpace -Descending
ASKER CERTIFIED SOLUTION
Avatar of Qlemo
Qlemo
Flag of Germany 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
Avatar of ARM2009

ASKER

exactly what i was looking for!!! thanks