Solved

powershell get-mailbox database from a csv

Posted on 2016-10-31
1
208 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 85

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

Enroll in June's Course of the Month

June's Course of the Month is now available! Every 10 seconds, a consumer gets hit with ransomware. Refresh your knowledge of ransomware best practices by enrolling in this month's complimentary course for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

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

In-place Upgrading Dirsync to Azure AD Connect
Windows 10 came with  a lot of built in applications, Some organisations leave them there, some will control them using GPO's. This Article is useful for those who do not want to have any applications in their image (example:me).
To show how to generate a certificate request 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 >> Certificates…
This video demonstrates how to sync Microsoft Exchange Public Folders with smartphones using CodeTwo Exchange Sync and Exchange ActiveSync. To learn more about CodeTwo Exchange Sync and download the free trial, go to: http://www.codetwo.com/excha…

726 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