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?
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?
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?
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.
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?
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
No worries :)
So it would be :
Get-Content userlist.txt | Get-Mailbox | Set-mailbox -prohibitsendreceivequota YYYY
Am I correct?
So it would be :
Get-Content userlist.txt | Get-Mailbox | Set-mailbox -prohibitsendreceivequota YYYY
Am I correct?
That is correct.
Get-Content userlist.txt | Get-Mailbox | Set-mailbox -identity XXXXX -prohibitsendreceivequota YYYY