Solved

Powershell for Mailbox Statics and applying storage quota by Office

Posted on 2010-09-08
8
1,399 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
  • 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
 
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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 500 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

Don't lose your head updating email signatures!

Do your end users still have the wrong email signature? Do email signature updates bore you or fill you with a sense of dread? You can make this a whole lot easier on yourself by trusting an Exclaimer email signature management solution. Over 50 million users do...so should you!

Join & Write a Comment

We are happy to announce a brand new addition to our line of acclaimed email signature management products – CodeTwo Email Signatures for Office 365.
Follow this checklist to learn more about the 15 things you should never include in an email signature from personal quotes, animated gifs and out-of-date marketing content.
In this video we show how to create a Resource Mailbox in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: Navigate to the Recipients >> Resources tab.: "Recipients" is our default selection …
This video discusses moving either the default database or any database to a new volume.

746 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now