Solved

powershell get-mailbox database from a csv

Posted on 2016-10-31
1
34 Views
Last Modified: 2016-10-31
cant see where i messed up any help?

Import-Csv “C:\Temp\username.csv” | ForEach-Object -Process {Get-Mailbox $_.Name | fl database} | Export-CSV “c:\temp\list.csv” -notype
0
Comment
Question by:Jorge Ocampo
1 Comment
 
LVL 83

Accepted Solution

by:
oBdA earned 500 total points
ID: 41867360
You've used "Format-List" ("fl") in the middle of a pipeline. Use Select-Object instead.
Import-Csv “C:\Temp\username.csv” | ForEach-Object -Process {Get-Mailbox $_.Name | Select-Object -Property database} | Export-CSV “c:\temp\list.csv” -notype

Open in new window

Rule of thumb: use any "Format-" cmdlet only ever as the last command of a pipeline.
1

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Join & Write a Comment

Synchronize a new Active Directory domain with an existing Office 365 tenant
Following basic email etiquette rules will help you write a professional email and achieve a good, lasting impression with your contacts.
In this video we show how to create a mailbox database in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Servers >> Data…
To show how to create a transport rule in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Mail Flow >> Rules tab.:  To cr…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now