[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 644
  • Last Modified:

exchange 2007/2010 mailbox sizes

Is there a way in powershell I can use an input text list of users/aliases to feed in and output mailbox sizes and item counts to a CSV file?
0
ENTPF
Asked:
ENTPF
  • 4
  • 3
1 Solution
 
AkhaterCommented:
import-csv c:\users.csv | get-mailboxstatistics | select-object displayname,itemcount,totalitemsize | export-csv c:\mailboxstat.csv
0
 
ENTPFAuthor Commented:
getting nothing in the output file.  
0
 
AkhaterCommented:
what do you have in your input file ?
what is the output of import-csv c:\users.csv alone
0
Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

 
ENTPFAuthor Commented:
just usernames in the input file.  
output file does not show anything even there is no command in between import and export.
0
 
AkhaterCommented:
import-csv c:\users.csv | get-mailboxstatistics

try this  alone any output?

0
 
ENTPFAuthor Commented:
Get-MailboxStatistics : The input object cannot be bound to any parameters for
the command either because the command does not take pipeline input or the inpu
t and its properties do not match any of the parameters that take pipeline inpu
t.
At line:1 char:74
0
 
AkhaterCommented:
ok


1. in the top of your csv file add name so it looks something like

name
administrator
ENTPF
AKhater

2. change the code to

import-csv "C:\userscsv" | foreach{ Get-MailboxStatistics $_.name |  select-object displayname,itemcount,totalitemsize} | Export-Csv c:\t.txt
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now