locked
Get-PublicFolder - error when exporting to .csv RRS feed

  • Question

  • I'm trying to get a list of all public folders using the below:

    Get-PublicFolder -server XXXX -recurse -resultsize unlimited | Export-Csv c:\pflist.csv

    it is then erroring when reaching a certain point:

    ..........................................................................

    Get-PublicFolder : MapiExceptionNotFound: Unable to open entry ID. (hr=0x800401
    0f, ec=-2147221233)
    Diagnostic context:
        Lid: 18969   EcDoRpcExt2 called [length=59]
        Lid: 27161   EcDoRpcExt2 returned [ec=0x0][length=304][latency=0]
        Lid: 23226   --- ROP Parse Start ---
        Lid: 27962   ROP: ropOpenFolder [2]
        Lid: 17082   ROP Error: 0x8004010F
        Lid: 21857
        Lid: 21921   StoreEc: 0x8004010F
        Lid: 27962   ROP: ropExtendedError [250]
        Lid: 1494    ---- Remote Context Beg ----
        Lid: 26426   ROP: ropOpenFolder [2]
        Lid: 3010    StoreEc: 0x8004010F
        Lid: 3010    StoreEc: 0x8004010F
        Lid: 3650    StoreEc: 0x8004010F
        Lid: 23921   StoreEc: 0x3EC
        Lid: 21970   StoreEc: 0x8004010F PropTag: 0x668F0040
        Lid: 23921   StoreEc: 0x3EC
        Lid: 21970   StoreEc: 0x8004010F PropTag: 0x663A000B
        Lid: 3010    StoreEc: 0x8004010F
        Lid: 3010    StoreEc: 0x8004010F
        Lid: 3650    StoreEc: 0x8004010F
        Lid: 23921   StoreEc: 0x3EC
        Lid: 21970   StoreEc: 0x8004010F PropTag: 0x66C40003
        Lid: 21970   StoreEc: 0x8004010F PropTag: 0x3D210102
        Lid: 19149   Error: 0x0
        Lid: 24509   Error: 0x0
        Lid: 31229   Error: 0x0
        Lid: 21970   StoreEc: 0x8004010F PropTag: 0x3FE00102
        Lid: 6244    StoreEc: 0x80070005
        Lid: 5884    StoreEc: 0x80070005
        Lid: 6527    StoreEc: 0x80070005
        Lid: 6527    StoreEc: 0x80070005
        Lid: 6719    StoreEc: 0x80070005
        Lid: 7007    StoreEc: 0x80070005
        Lid: 1750    ---- Remote Context End ----
        Lid: 31418   --- ROP Parse Done ---
        Lid: 22894
        Lid: 24942   StoreEc: 0x8004010F
    At line:1 char:17
    + Get-PublicFolder <<<<  -server ogjerexmb05 -recurse -resultsize unlimited | E
    xport-Csv c:\pflist.csv
        + CategoryInfo          : NotSpecified: (0:Int32) [Get-PublicFolder], Mapi
       ExceptionNotFound
        + FullyQualifiedErrorId : 4C4D4DE4,Microsoft.Exchange.Management.MapiTasks
       .GetPublicFolder

    .............................................................

    Is there a way that I can exclude the sub-folder that I suspect is causing the issue from the export, thereby skipping it and continuing with the the export?

    Thanks in advance,

    Chris.


    Wednesday, June 7, 2017 3:14 PM

Answers

  • Get-PublicFolder ...   -ErrorAction SilentlyContinue


    \_(ツ)_/

    • Proposed as answer by Hello_2018 Tuesday, June 13, 2017 3:12 AM
    • Marked as answer by ChrisA85 Tuesday, June 13, 2017 9:14 AM
    Wednesday, June 7, 2017 7:33 PM
  • Hi Chris,

    >>Is there a way that I can exclude the sub-folder that I suspect is causing the issue from the export, thereby skipping it and continuing with the the export?

    Besides of using -EA to bypass the error, you could test these connections before Get these folders.

    Try:

    $servers = Get-Content .\servers.txt
    foreach($server in $servers)
    {
        if(Test-MapiConnectivity -Server $server)
        {
           Get-PublicFolder -server $server -recurse  -resultsize unlimited | Export-Csv c:\pflist.csv 
        }else{
            Write-Host "connect to $server failed!"
        }
    }
    
    

    Best regards,

    Andy


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    • Proposed as answer by Hello_2018 Tuesday, June 13, 2017 3:12 AM
    • Unproposed as answer by Hello_2018 Tuesday, June 13, 2017 3:12 AM
    • Marked as answer by ChrisA85 Tuesday, June 13, 2017 9:14 AM
    Thursday, June 8, 2017 9:20 AM

All replies

  • Get-PublicFolder ...   -ErrorAction SilentlyContinue


    \_(ツ)_/

    • Proposed as answer by Hello_2018 Tuesday, June 13, 2017 3:12 AM
    • Marked as answer by ChrisA85 Tuesday, June 13, 2017 9:14 AM
    Wednesday, June 7, 2017 7:33 PM
  • Hi Chris,

    >>Is there a way that I can exclude the sub-folder that I suspect is causing the issue from the export, thereby skipping it and continuing with the the export?

    Besides of using -EA to bypass the error, you could test these connections before Get these folders.

    Try:

    $servers = Get-Content .\servers.txt
    foreach($server in $servers)
    {
        if(Test-MapiConnectivity -Server $server)
        {
           Get-PublicFolder -server $server -recurse  -resultsize unlimited | Export-Csv c:\pflist.csv 
        }else{
            Write-Host "connect to $server failed!"
        }
    }
    
    

    Best regards,

    Andy


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    • Proposed as answer by Hello_2018 Tuesday, June 13, 2017 3:12 AM
    • Unproposed as answer by Hello_2018 Tuesday, June 13, 2017 3:12 AM
    • Marked as answer by ChrisA85 Tuesday, June 13, 2017 9:14 AM
    Thursday, June 8, 2017 9:20 AM
  • Thanks guys, much appreciated.
    Tuesday, June 13, 2017 9:15 AM