[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 406
  • Last Modified:

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?
0
kam_uk
Asked:
kam_uk
  • 4
  • 2
1 Solution
 
Chris PattersonCommented:
Use the following command:

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

0
 
kam_ukAuthor Commented:
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?
0
 
Chris PattersonCommented:
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.
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
kam_ukAuthor Commented:
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?
0
 
Chris PattersonCommented:
Ah, my apologies, disgard the "-identity XXXXX" section, the identity is piped in form the previous commands.
0
 
Joe_BuddenCommented:
No worries :)

So it would be :

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

Am I correct?

0
 
Chris PattersonCommented:
That is correct.
0

Featured Post

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!

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now