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

x
?
Solved

Exchange 2010 PowerScript Issue - Recipient Limit

Posted on 2011-10-27
4
Medium Priority
?
1,243 Views
Last Modified: 2012-05-12
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
Comment
Question by:JamesonJendreas
  • 2
4 Comments
 
LVL 12

Expert Comment

by:prashanthd
ID: 37039542

Try the following..


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

Open in new window

0
 
LVL 12

Expert Comment

by:prashanthd
ID: 37039618
Typo error...
$mailgroup = Get-DistributionGroupMember Mailgroup | get-mailbox
$mailgroup | % {  set-mailbox $_ -RecipientLimits 500

Open in new window

0
 
LVL 37

Accepted Solution

by:
Jamie McKillop earned 2000 total points
ID: 37039688
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
 
LVL 1

Author Closing Comment

by:JamesonJendreas
ID: 37041380
.identity is required!

Cheers
JJ
0

Featured Post

A Cyber Security RX to Protect Your Organization

Join us on December 13th for a webinar to learn how medical providers can defend against malware with a cyber security "Rx" that supports a healthy technology adoption plan for every healthcare organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Steps to fix “Unable to mount database. (hr=0x80004005, ec=1108)”.
Transferring FSMO roles is done when an admin wants to split roles between certain Domain Controllers or the Domain Controller holding the Roles has been forcefully demoted using dcpromo / forceremoval
To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
Suggested Courses

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question