Solved

Exchange Management Shell Error

Posted on 2014-10-07
14
128 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
  • 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
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

A procedure for exporting installed hotfix details of remote computers using powershell
How to resolve IMCEAEX NDRs in Exchange or Exchange Online related to invalid X500 addresses.
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
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

829 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