• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 409
  • 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 PattersonSenior Systems EngineerCommented:
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 PattersonSenior Systems EngineerCommented:
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
Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

 
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 PattersonSenior Systems EngineerCommented:
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 PattersonSenior Systems EngineerCommented:
That is correct.
0
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.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

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