Link to home
Start Free TrialLog in
Avatar of kam_uk
kam_uk

asked on

Applying mailbox quota to txt file of users

Hi

Running Exchange 2007. I have a TXT file of 50 users that I need to apply a prohibitsendreceive quota on.

I know the Powershell command to do this on one:

Set-mailbox -identity XXXXX -prohibitsendreceivequota YYYY

But can someone tell me how to do this when they're listed in a seperate file? I know it's pretty easy, but not sure how?
Avatar of Chris Patterson
Chris Patterson

Use the following command:

Get-Content userlist.txt | Get-Mailbox | Set-mailbox -identity XXXXX -prohibitsendreceivequota YYYY

Avatar of kam_uk

ASKER

Thanks!

Out of interest, is there another way of writing this along the following lines

Get-mailbox <userlist.txt> | set-mailbox etc etc

I'm just not sure how to write the first bit?
the first bit is also a built in cmdlet.  You have to use the Get-Content cmdlet to read the text files and then pipe that output to the next command.
Avatar of kam_uk

ASKER

You're saying to use:

Get-Content userlist.txt | Get-Mailbox | Set-mailbox -identity XXXXX -prohibitsendreceivequota YYYY


But the identity is from the userlist.txt, how would I know what to write there?
ASKER CERTIFIED SOLUTION
Avatar of Chris Patterson
Chris Patterson

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
No worries :)

So it would be :

Get-Content userlist.txt | Get-Mailbox | Set-mailbox -prohibitsendreceivequota YYYY

Am I correct?

That is correct.