Link to home
Start Free TrialLog in
Avatar of jahhan
jahhan

asked on

Powershell script to display Exchange 2003 Mailboxes by Location

I am currently running the following script to display the number of mailboxes that exist in the Exchange 2003 environment:
$servers='server01'#, 'server02'
$outfile="c:\scripts\serverbylocation.csv"
 Get-Wmiobject -namespace root\MicrosoftExchangeV2 -class Exchange_Mailbox -computer $servers `
| select-object MailboxDisplayName,Size,ServerName,StorageGroupName,StoreName `
| export-csv $outfile -notype

What do I need to do to add in the AD object of  physicaldeliveryofficename?
What I would like to do is have the option to sort my results by location.
Avatar of Jamie_Wilson
Jamie_Wilson

Can you just not add physicaldeliveryofficename to your current script ?

e.g.
$servers='server01'#, 'server02'
$outfile="c:\scripts\serverbylocation.csv"
 Get-Wmiobject -namespace root\MicrosoftExchangeV2 -class Exchange_Mailbox -computer $servers `
| select-object MailboxDisplayName,Size,ServerName,StorageGroupName,StoreName,physicaldeliveryofficename `
| export-csv $outfile -notype
Avatar of jahhan

ASKER

I tried that but when I execute the script that column is blank.
Do you get the same thing if physicaldeliveryofficename is the 1st object?
Avatar of jahhan

ASKER

Yes and the same outcome.
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