Powershell import-csv question

Hi,

I have a CSV file with two columns; the first column is a “mailbox” and the second column is a proposed “MaxSendSize”(i.e each row has a different mailbox name and a different “MaxSendSize” number).

I need a powershell script that can read from this CSV file so that it can set the MaxSendSize for every mailbox on exchange as per this CSV file.

For powershell scriptwriters with no exchange cmdlet knowledge, this is how the maxsendsize id usually set:

Get-mailbox “mailbox from the csv file” | Set-Mailbox –MaxSendSize “from the CSV file on the same raw”
datacomsmtAsked:
Who is Participating?
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.

Manpreet SIngh KhatraSolutions Architect, Project LeadCommented:
Try with one or 2 and see if that helps
Import-Csv "name".csv | Set-Mailbox

- Rancy
0
Manpreet SIngh KhatraSolutions Architect, Project LeadCommented:
Using the Import-Csv Cmdlet
http://technet.microsoft.com/en-us/library/ee176874.aspx

- Rancy
0
Manpreet SIngh KhatraSolutions Architect, Project LeadCommented:
Found something more so though of sharing

http://www.netometer.com/video/tutorials/how-to-bulk-create-and-modify-users-in-Active-Directory-Exchange-2010-Management-Shell/

## Import data from csv and store it in variable 'data'

$data = import-csv $args[0]

foreach ($i in $data)
{
 $alias = $i.First[0] + $i.Last

 $custom1 = $i.Custom1

 Set-Mailbox -Identity $alias -CustomAttribute1 $custom1
}

- Rancy
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

datacomsmtAuthor Commented:
Hi Rancy,

Thanks for your help, but non of this answers my question...
I believe it should be a 3-4 line script to "read" each mailbox namde, | set the value from the same raw..
0
Manpreet SIngh KhatraSolutions Architect, Project LeadCommented:
Can you try with someone just for testing with a csv for 2 users ?

Import-csv "C:\filename.csv" | foreach {set-mailbox $_.MaxSendSize $_.name}

http://www.experts-exchange.com/Software/Server_Software/Email_Servers/Exchange/Q_26990630.html
1. Create a CSV file with all the usernames of all users whom you want to change message size - with heading for that column as UName
2. run the below powershell cmdlets

$users = import-csv "<Location of CSV>"
$users | foreach{set-mailbox -identity $_.UName -MaxReceiveSize <Size> -MaxSendSize <Size> -whatif}

- Rancy
0
slidingfoxCommented:
Import-CSV C:\mailboxes.csv | 
ForEach-Object { 
    Set-Mailbox -Identity $_.Mailbox -MaxSendSize $_.MaxSendSize
}

Open in new window

0

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
datacomsmtAuthor Commented:
Thanks!
0
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
Powershell

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.