• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1257
  • Last Modified:

Exchange 2010 PowerScript Issue - Recipient Limit

So I've created a simple powershell scrip that is supposed to set my Exchange 2010 users max allowed recipients for sending mail.  Essentially I have two groups, first, my normal users, who should only be able to send to 30 people max.  Second, I have my exec/hr group, that needs pretty much unrestricted sending.  So with a little assistance (or complete assistance, I'm still learning all the  Exchange Powershell cmdlets) I cam up with:

$users= get-mailbox -resultsize unlimited
$users | % { set-mailbox $_ -RecipientLimits 30}
$mailgroup = Get-DistributionGroupMember Mailgroup
$mailgroup | % {  set-mailbox $_ -RecipientLimits 500}

This works up until the last command, where it kicks back an error for each of my users in the defined group.  I even attempted to just recall the  "$users | % { set-mailbox $_ -RecipientLimits 30}" and replace the "$users" with "mailgroup" and 30 with 500 (also, not replacing the 30).  Get the same error.


Error is:
Cannot process argument transformation on parameter 'Identity'. Cannot convert the "foxshox.com/Domain Users 130/Larry
Enterline" value of type "Microsoft.Exchange.Data.Directory.Management.ReducedRecipient" to type "Microsoft.Exchange.Co
nfiguration.Tasks.MailboxIdParameter".
    + CategoryInfo          : InvalidData: (:) [Set-Mailbox], ParameterBindin...mationException
    + FullyQualifiedErrorId : ParameterArgumentTransformationError,Set-Mailbox

Cheers,
JJ
0
JamesonJendreas
Asked:
JamesonJendreas
  • 2
1 Solution
 
prashanthdCommented:

Try the following..


$mailgroup = Get-DistributionGroupMember Mailgroup | get-distributiongroupmember
$mailgroup | % {  set-mailbox $_ -RecipientLimits 500 }

Open in new window

0
 
prashanthdCommented:
Typo error...
$mailgroup = Get-DistributionGroupMember Mailgroup | get-mailbox
$mailgroup | % {  set-mailbox $_ -RecipientLimits 500

Open in new window

0
 
Jamie McKillopIT ManagerCommented:
Hello,

Change the last line to this: $mailgroup | % {  set-mailbox $_.identity -RecipientLimits 500}

You need to specify the identity parameter because the value types don't match.

JJ
0
 
JamesonJendreasAuthor Commented:
.identity is required!

Cheers
JJ
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

Protect Your Employees from Wi-Fi Threats

As Wi-Fi growth and popularity continues to climb, not everyone understands the risks that come with connecting to public Wi-Fi or even offering Wi-Fi to employees, visitors and guests. Download the resource kit to make sure your safe wherever business takes you!

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