Solved

powershell get-mailbox database from a csv

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

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

Office 365 Training for IT Pros

Learn how to provision Office 365 tenants, synchronize your on-premise Active Directory, and implement Single Sign-On.

Question has a verified solution.

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

This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Auditing domain password hashes is a commonly overlooked but critical requirement to ensuring secure passwords practices are followed. Methods exist to extract hashes directly for a live domain however this article describes a process to extract u…
This video discusses moving either the default database or any database to a new volume.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

734 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