Assigning full access permission to backup service account failing..

Ali-Raza111
Ali-Raza111 used Ask the Experts™
on
Hi All,

I'm trying to assigned full permission access to backup service account to restore any account but failing due to remote client exceeded the allowed maximum any thoughts on below error!


[PS] C:\Windows\system32>Get-Mailbox -ResultSize Unlimited | Add-MailboxPermission -User "SVC_Account" -AccessRights
 FullAccess
Sending data to a remote command failed with the following error message: [ClientAccessServer=Exchange2013.local,BackEndServer
=Exchange2013.local,RequestId=4a7a1c5d-37bd-488c-b446-3f69d5843040,TimeStamp=11/9/2017 11:01:49 PM]
[FailureCategory=WSMan-Others] The total data received from the remote client exceeded the allowed maximum. The
allowed maximum is 524288000. For more information, see the about_Remote_Troubleshooting Help topic.
    + CategoryInfo          : OperationStopped: (Exchange2013.local:String) [], PSRemotingTransportException
    + FullyQualifiedErrorId : JobFailure
    + PSComputerName        : Exchange2013.local
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Consultant
Commented:
Hi,

I think you need to breakdown the mailboxes into smaller 'chunks'.

For example, do all the mailboxes starting with each letter separately with a script like this:

Get-Mailbox -Identity A* | Add-MailboxPermission -User "SVC_Account" -AccessRights FullAccess
Get-Mailbox -Identity B* | Add-MailboxPermission -User "SVC_Account" -AccessRights FullAccess
Get-Mailbox -Identity C* | Add-MailboxPermission -User "SVC_Account" -AccessRights FullAccess
Get-Mailbox -Identity D* | Add-MailboxPermission -User "SVC_Account" -AccessRights FullAccess
Get-Mailbox -Identity E* | Add-MailboxPermission -User "SVC_Account" -AccessRights FullAccess
Get-Mailbox -Identity F* | Add-MailboxPermission -User "SVC_Account" -AccessRights FullAccess
Get-Mailbox -Identity G* | Add-MailboxPermission -User "SVC_Account" -AccessRights FullAccess
Get-Mailbox -Identity H* | Add-MailboxPermission -User "SVC_Account" -AccessRights FullAccess
Get-Mailbox -Identity I* | Add-MailboxPermission -User "SVC_Account" -AccessRights FullAccess
Get-Mailbox -Identity J* | Add-MailboxPermission -User "SVC_Account" -AccessRights FullAccess
Get-Mailbox -Identity K* | Add-MailboxPermission -User "SVC_Account" -AccessRights FullAccess
Get-Mailbox -Identity L* | Add-MailboxPermission -User "SVC_Account" -AccessRights FullAccess
Get-Mailbox -Identity M* | Add-MailboxPermission -User "SVC_Account" -AccessRights FullAccess
Get-Mailbox -Identity N* | Add-MailboxPermission -User "SVC_Account" -AccessRights FullAccess
Get-Mailbox -Identity O* | Add-MailboxPermission -User "SVC_Account" -AccessRights FullAccess
Get-Mailbox -Identity P* | Add-MailboxPermission -User "SVC_Account" -AccessRights FullAccess
Get-Mailbox -Identity Q* | Add-MailboxPermission -User "SVC_Account" -AccessRights FullAccess
Get-Mailbox -Identity R* | Add-MailboxPermission -User "SVC_Account" -AccessRights FullAccess
Get-Mailbox -Identity S* | Add-MailboxPermission -User "SVC_Account" -AccessRights FullAccess
Get-Mailbox -Identity T* | Add-MailboxPermission -User "SVC_Account" -AccessRights FullAccess
Get-Mailbox -Identity U* | Add-MailboxPermission -User "SVC_Account" -AccessRights FullAccess
Get-Mailbox -Identity V* | Add-MailboxPermission -User "SVC_Account" -AccessRights FullAccess
Get-Mailbox -Identity W* | Add-MailboxPermission -User "SVC_Account" -AccessRights FullAccess
Get-Mailbox -Identity X* | Add-MailboxPermission -User "SVC_Account" -AccessRights FullAccess
Get-Mailbox -Identity Y* | Add-MailboxPermission -User "SVC_Account" -AccessRights FullAccess
Get-Mailbox -Identity Z* | Add-MailboxPermission -User "SVC_Account" -AccessRights FullAccess

Open in new window


We could do it with a loop too, but the above is simple.

Alan.

Author

Commented:
Thanks Alan,

I was checking same thing for my script too which pulls all the users in the organization. For assigning full permission your suggested solutions worked.

Below is the script, i'm using to pull all the mailbox users and export into PST.

get-mailbox -resultsize unlimited -erroraction silentlycontinue | Get-MailboxStatistics | select-object *,@{name="TotalItemSizeinMB";expression={[math]::Round($_.totalitemsize.value.ToBytes() / 1MB,2)}},@{name="TotalDeletedItemSizeinMB";expression={[math]::Round($_.totaldeleteditemsize.value.ToBytes() / 1MB,2)}},@{name="CombinedTotalSizeinMB";expression={[math]::Round($_.totalitemsize.value.ToBytes() / 1MB,2) + [math]::Round($_.totaldeleteditemsize.value.ToBytes() / 1MB,2)}},@{name=“SourceDatabase”;expression={$_.Database}} | sort-object combinedtotalsizeinMB -Descending | select displayname, *GUID*, *MB,ItemCount, DeletedItemCount, LastLogonTime,SourceDatabase | export-csv -force -notype C:\Temp\test.csv
AlanConsultant

Commented:
Bit hard to read, but is that all one line / command?  If so, well played Sir!

Without pulling it apart and trying it myself, if you want to just export all the mailboxes, there are easier (shorter!) ways, but if it works, it works :-)

Alan.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial