Solved

Exchange Management Shell Error

Posted on 2014-10-07
14
127 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
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 39

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

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.

Question has a verified solution.

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

This article lists the top 5 free OST to PST Converter Tools. These tools save a lot of time for users when they want to convert OST to PST after their exchange server is no longer available or some other critical issue with exchange server or impor…
This article explains how to install and use the NTBackup utility that comes with Windows Server.
In this video we show how to create a Contact 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 Recipients >> Contact ta…
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…

785 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