Solved

powershell get-mailbox database from a csv

Posted on 2016-10-31
1
78 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

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Marketers need statistics and metrics like everybody else needs oxygen. In this article we explain how to enable marketing campaign statistics for Microsoft Exchange mail.
Find out what you should include to make the best professional email signature for your organization.
In this video we show how to create a Shared Mailbox 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 Recipients >> Sha…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

770 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