Access Denied on New-MailboxExportRequest for some mailboxes only

Aamir Yaseen 1 Reputation point
2022-06-21T05:32:22.79+00:00

Hello All,

I am exporting a bunch of mailboxes from Exchange PowerShell (Exchange Server 2016) and it works fine for majority of the mailboxes, however seems to fail for a few of them. Around 10% failure rate. Note that even though the error indicates that the system doesn't have access to the file, it never creates the file and the file doesn't exist beforehand either. Exchange Trusted Subsystem and the user account used to perform the export have full access to the UNC path.

Command used:

$csv | % {New-MailboxExportRequest -Mailbox $_.SamAccountName -FIlePath \\uncpath\$($_.SamAccountName).pst}   

Error received:

New-MailboxExportRequest : Unable to open PST file '\\uncpath\samplename.pst'. Error details: Access to the path '\\uncpath\samplename.pst' is denied.   

Will be grateful if anyone has any information about this.

Best Regards,
Aamir

Exchange Server Management
Exchange Server Management
Exchange Server: A family of Microsoft client/server messaging and collaboration software.Management: The act or process of organizing, handling, directing or controlling something.
7,662 questions
{count} votes

1 answer

Sort by: Most helpful
  1. KyleXu-MSFT 26,266 Reputation points
    2022-06-22T02:05:15.27+00:00

    @Aamir Yaseen

    Based on your description, you could export most of mailboxes successfully, it means there doesn't exist issue with permission for Exchange server and target folder.

    I would suggest you take steps below to narrow down it:

    Use command below to check the SamAccountName for failed mailbox, then try to export data for this mailbox specialized. Check whether could export successfully.

    $t=(Get-Mailbox FailedMailbox).SamAccountName  
    New-MailboxExportRequest -Mailbox $t -FIlePath \\EXCH\temp\$($t).pst  
    

    If you cannot export data for this mailbox, it means there may exist issue this mailbox itself. Try to migrate this mailbox to another database, the migration action could repair some issue for mailbox.

    If you could export data for this mailbox, it means there may exist limitation on session for export. I would suggest you try to split the source CSV into multiple part, then check whether could export all mailbox successfully.

    You can also try with "UserPrincipalName" rather than "SamAccountName".


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.