Import to CSV from Exchange 2010

I imported a list of users from a CSV file into a variable in EMS so that I can adjust mailbox quota warnings prohitsend and prohibitsendreceive. This worked fine, but I can't see to export the results of these changes to another csv file. Can anyone point me in the right direction.
LVL 26
timgreen7077Exchange EngineerAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Amit KumarCommented:
use below one:

Get-mailbox -ResultSize unlimited | select Name,PrimarySMTPAddress,issuewarningquota,ProhibitSendquota,ProhibitSendReceiveQuota | Export-csv c:\data.csv

Open in new window

timgreen7077Exchange EngineerAuthor Commented:
How can I do this just for users in a csv file. When I try the below only 1 user is outputted:

$userlist = import-csv .\limit.csv
foreach ($user in $userlist){
get-mailbox -Identity $user.email | select name,issuewarningquota,prohibitsendquota,prohibitsendreceivequota | Export-Csv .\viewer.csv
}

and the example you gave will search all mailboxes when I only need to get the info for users in the limit csv and then output to new csv named what ever.
Jeremy WeisingerSenior Network Consultant / EngineerCommented:
Add -append to your Export-CSV cmdlet.

$userlist = import-csv .\limit.csv
foreach ($user in $userlist){
get-mailbox -Identity $user.email | select name,issuewarningquota,prohibitsendquota,prohibitsendreceivequota | Export-Csv .\viewer.csv -append
}

Open in new window

Discover the Answer to Productive IT

Discover app within WatchGuard's Wi-Fi Cloud helps you optimize W-Fi user experience with the most complete set of visibility, troubleshooting, and network health features. Quickly pinpointing network problems will lead to more happy users and most importantly, productive IT.

timgreen7077Exchange EngineerAuthor Commented:
This is the error i got when -append was added:
Export-Csv : A parameter cannot be found that matches parameter name 'append'.

I'm using exchange management shell but powershell 2.0

any other suggestions by chance.
Jeremy WeisingerSenior Network Consultant / EngineerCommented:
Ohhhhhhh. Powershell 2.0, eh?

Try this:
$userlist = import-csv .\limit.csv
foreach ($user in $userlist){
$results += get-mailbox -Identity $user.email | select name,issuewarningquota,prohibitsendquota,prohibitsendreceivequota
}
$results | Export-Csv .\viewer.csv

Open in new window

timgreen7077Exchange EngineerAuthor Commented:
This is the error I now get:

+= : Method invocation failed because [System.Management.Automation.PSObject] doesn't contain a method named 'op_Addition'.
At line:2 char:12
+ $results += <<<<  get-mailbox -Identity $user.email | select name,issuewarningquota,prohibitsendquota,prohibitsendreceivequota
    + CategoryInfo          : InvalidOperation: (op_Addition:String) [], RuntimeException
    + FullyQualifiedErrorId : MethodNotFound
Jeremy WeisingerSenior Network Consultant / EngineerCommented:
Powershell 2.0 (!@$#%!@#@#$)

I have nothing to test with but I think this should work:

$userlist = import-csv .\limit.csv
foreach ($user in $userlist){
    $lo = get-mailbox -Identity $user.email | select name,issuewarningquota,prohibitsendquota,prohibitsendreceivequota
    $results = $results + $lo
 }
$results | Export-Csv .\viewer.csv

Open in new window

timgreen7077Exchange EngineerAuthor Commented:
Nope same error. I will update WMF and get a more current verison of PS and give it a try.
Amit KumarCommented:
Try this one, it will for sure work in PS 2.0

$userlist = import-csv .\limit.csv 
$results = foreach($user in $userlist) {get-mailbox -Identity $user.email | select name,issuewarningquota,prohibitsendquota,prohibitsendreceivequota} 
$results | Export-Csv .\viewer.csv

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
timgreen7077Exchange EngineerAuthor Commented:
Perfect and thanks.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Exchange

From novice to tech pro — start learning today.