when relevant content is
added and updated.
One of our Mail Administrators is new to the world of Exchange as we are currently migrating from Lotus Notes. She is also new to the world of scripting but is eager to learn how to administer exchange using Powershell. I sat with her today and we walked through a simple example of how to set quotas for user mailboxes. Here is what we did:
$names = Import-Csv “path to csv file containing first and last names”
foreach($name in $names)
$first = $name.first
$last = $name.last
$identity = “$last, $first”
set-mailbox `”$identity`” -issuewarningquota 180mb
So let’s break this down a bit.
- I had the mail admin get a list of all the users and put them In a csv file with the headers of first, last
- We bring that in and assign the variables $first and $last
I then create the $identity variable and assign that with $last, $first so it would look like ‘Smith, John’
- This is so we modify the correct mailbox
Then I use the exchange commandlet set-mailbox and pass it the $identity variable and the parameters that I want to change.
- In this case only the issuewarningquota parameter is being modified.
- Then I do a get-mailbox for the same $identity and I pipe that to format-table and look at the name and the parameter that I just modified in order to make sure that it has been set correctly.
That is it. It is so easy to make these changes to a huge number of users. If you have any questions or comments please let me know. Also if you would like to drop me a line head over to http://sysadminsmith.com and submit a question.