Solved

Exchange Management Shell Error

Posted on 2014-10-07
14
130 Views
Last Modified: 2014-10-07
I get the attached image error when I try to running a the following cmdlet:
Get-Mailbox -ResultSize Unlimited | Get-MailboxPermission -User "username" | ft identity, AccessRights

Capture.JPG
I have also run the following cmd to try and overcome this error with no luck:
Get-Item WSMAN:\localhost\Shell\MaxMemoryPershellMB 102400 -force

Any assistance would be great.
0
Comment
Question by:timgreen7077
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 8
  • 5
14 Comments
 
LVL 16

Assisted Solution

by:Joshua Grantom
Joshua Grantom earned 250 total points
ID: 40366025
You cannot override the default size but you can change the formatting of your script to achieve the same results. It sends the requests individually to overcome the size limit

$mailboxes = get-mailbox -Resultsize unlimited
foreach($box in $mailboxes){
get-mailboxpermission -user "username" | ft identity,Accessrights
}

Open in new window

0
 

Author Comment

by:timgreen7077
ID: 40366129
I ran the cmdlet you mentioned and get the following. See image:

Capture2.JPG
0
 
LVL 16

Expert Comment

by:Joshua Grantom
ID: 40366146
My fault, -user should be -identity

$mailboxes = get-mailbox -Resultsize unlimited
foreach($box in $mailboxes){
get-mailboxpermission -identity "username" | ft identity,Accessrights
}

Open in new window

0
Does Powershell have you tied up in knots?

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

 

Author Comment

by:timgreen7077
ID: 40366219
I tried by entering -identity and it brings up page after page of the user's primary mailbox, but it never brings up any functional mailboxes the user has full manage access to granted via Exchange. When I enter:
get-mailboxpermission -user "username" | ft identity,Accessrights
it would bring up the mailboxes that the user has full manage access to along with his primary mailbox, but when I user
-user in the script you sent it asks for identity.
0
 
LVL 16

Expert Comment

by:Joshua Grantom
ID: 40366229
So what information are you wanting? Who has full access permissions for every mailbox? or all permissions for a single user?
0
 
LVL 16

Expert Comment

by:Joshua Grantom
ID: 40366250
This will give you a list of who has full access permissions for each mailbox
$mailboxes = get-mailbox -Resultsize unlimited
foreach($box in $mailboxes){
Get-MailboxPermission | where { ($_.AccessRights -eq “FullAccess”) | ft identity,User
}

Open in new window

0
 
LVL 16

Expert Comment

by:Joshua Grantom
ID: 40366270
Or if you are wanting to see what mailboxes a single user has full access to,

$mailboxes = get-mailbox -Resultsize unlimited
foreach($box in $mailboxes){
get-mailboxpermission -identity $_. -user "username" | ft identity,Accessrights
}

Open in new window

0
 

Author Comment

by:timgreen7077
ID: 40366301
I'm trying to see what mailboxes a single user has full manage access to. I will try the one you sent and let you know. Thanks for your help and the quick responses.
0
 

Author Comment

by:timgreen7077
ID: 40366317
I get the below error:
Cannot bind argument to parameter 'Identity' because it is null.
    + CategoryInfo          : InvalidData: (:) [Get-MailboxPermission], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Get-MailboxPermission
    + PSComputerName        : houvxhc2.mustangeng.com
0
 
LVL 16

Expert Comment

by:Joshua Grantom
ID: 40366347
Try this, I apologize, I no longer have an exchange environment to test on. We moved to google apps.

$mailboxes = Get-Mailbox -ResultSize Unlimited -properties Identity | Select Identity
foreach ($mailbox in $mailboxes) {
Get-MailboxPermission -identity $_.Identity -User "username" | FT Identity,AccessRights
}

Open in new window

0
 
LVL 16

Expert Comment

by:Joshua Grantom
ID: 40366361
This may work also

$mailboxes = Get-Mailbox -ResultSize Unlimited
foreach ($mailbox in $mailboxes) {
Get-MailboxPermission | where { ($_.User -like “username”) -and ($_.AccessRights -eq “FullAccess”) } | FT Identity,AccessRights
}

Open in new window

0
 
LVL 40

Accepted Solution

by:
footech earned 250 total points
ID: 40366544
Here's a version of Joshua's code with correct syntax.
$mailboxes = Get-Mailbox -ResultSize Unlimited
foreach ($mailbox in $mailboxes)
{ Get-MailboxPermission -Identity $mailbox.Alias -User "username" | ft identity, AccessRights }

Open in new window

0
 
LVL 16

Expert Comment

by:Joshua Grantom
ID: 40366561
thanks footech
0
 

Author Closing Comment

by:timgreen7077
ID: 40366702
Thank you gentlemen. Footech's correction solved the issue.
0

Featured Post

Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

How to resolve IMCEAEX NDRs in Exchange or Exchange Online related to invalid X500 addresses.
A list of top three free exchange EDB viewers that helps the user to extract a mailbox from an unmounted .edb file and get a clear preview of all emails & other items with just a single click on mailboxes.
In this video we show how to create an Address List in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Organization >> Ad…
The video tutorial explains the basics of the Exchange server Database Availability groups. The components of this video include: 1. Automatic Failover 2. Failover Clustering 3. Active Manager

707 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