?
Solved

Powershell for Mailbox Statics and applying storage quota by Office

Posted on 2010-09-08
8
Medium Priority
?
1,415 Views
Last Modified: 2012-05-10
1.  Is there a powershell to get the information of each mailbox by office location and export it to a csv with Name, Office, mailbox size in mb?
2.  Set quota: Issue warning, Prohibitsend by Office

Thanks
0
Comment
Question by:warcraft3dh
[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
  • 5
  • 2
8 Comments
 
LVL 53

Expert Comment

by:Will Szymkowski
ID: 33632756
Prohibit Send = get-mailbox | set-mailbox -prohibitsendquota 500MB

Take a look here for the rest...
http://www.simple-talk.com/sysadmin/powershell/managing-exchange-2007-mailbox-quotas-with-windows-powershell/

Hope this helps~!
0
 
LVL 32

Expert Comment

by:endital1097
ID: 33632774
get-mailbox -organizationalunit contoso.com/ouname | select name,ProhibitSendQuota,ProhibitSendReceiveQuota,IssueWarningQuota,Office |export-csv c:\users.csv

you'll need to run another for the mailbox size
get-mailbox | get-mailboxstatistics | export-csv c:\size.csv
0
 

Author Comment

by:warcraft3dh
ID: 33638896
I'm trying to run this powershell but it keep erroring out:

http://technet.microsoft.com/en-us/library/ff406197(EXCHG.80).aspx

Export storage quota of all mailboxes in an office (using $OfficeName variable)

$OfficeName = "<Office_Name>"get-mailbox -filter {Office -eq $OfficeName } | select name,office, *quota | sort name | export-csv export.csv

Error:
[PS] C:\>$Officename = "Valencia" get-mailbox -filter {office -eq $OfficeName }
|select name, office, *quota | wort name | export-csv office.csv
Unexpected token 'get-mailbox' in expression or statement.
At line:1 char:37
+ $Officename = "Valencia" get-mailbox  <<<< -filter {office -eq $OfficeName }
|select name, office, *quota | wort name | export-csv office.csv
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 32

Expert Comment

by:endital1097
ID: 33638950
to filter the results of mailboxes by office the command is
Get-Mailbox -Filter { Office -eq "Valencia" } |  select name,office, *quota | sort name | export-csv export.csv
0
 
LVL 32

Expert Comment

by:endital1097
ID: 33638966
also you cannot use * with the select statement, it only works with format-list and format-table
0
 
LVL 32

Expert Comment

by:endital1097
ID: 33638973
nevermind, i was thinking of something else
0
 

Author Comment

by:warcraft3dh
ID: 33718504
This powershell works great getting the mailbox information for the office:
Get-Mailbox -Filter { Office -eq "Mission Plaza" } |  select name,office, *quota | sort name | export-csv export.csv

Now I want to implement the Quota size for this office.  I got an error when running this powershell:

Get-Mailbox -Filter { Office -eq "Mission Plaza" } | Set-Mailbox { Office -eq "Mission Plaza" } -UseDatabaseQuotaDefaults:$False -IssueWarningQuota 150 MB -ProhibitSendQuota 200 MB

Error:
Set-Mailbox : A parameter cannot be found that matches parameter name 'Office -eq "Mission Plaza" '.
At line:1 char:65
0
 
LVL 32

Accepted Solution

by:
endital1097 earned 2000 total points
ID: 33718534
your get cmdlet filters as needed

Get-Mailbox -Filter { Office -eq "Mission Plaza" } | Set-Mailbox -UseDatabaseQuotaDefaults:$False -IssueWarningQuota 150 MB -ProhibitSendQuota 200 MB

0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

A list of top three free exchange EDB viewers that helps the user to extract a mailbox from an unmounted .edb file and get a clear preview of all emails & other items with just a single click on mailboxes.
A couple of months ago we ran into an issue that necessitated re-creating our Edge Subscriptions. However, when we attempted to execute the command: New-EdgeSubscription -filename C:\NewEdgeSub_01.xml we received an error indicating that the LDAP se…
In this video we show how to create an email address policy 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 Mail Flow…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…

762 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