none
Export data exceeds maximum

    Question


  • I have searched the forum for the error below but have not found an answer to fix this issue.

    When I run the command below with a resultsize of 10000 it works fine, but when I run with 20000 it errors. I have about 16,500 records to export. Is there a better way to pipe the command together to be more efficient? I need to get the three fields from the MailContact information where the Contact company field equals 'Company - Individuals'.

    Thanks!

    Get-Contact -resultsize 20000 -Filter "Company -eq 'Company - Individuals'" | Get-MailContact | Select-Object DisplayName, Alias, PrimarySmtpAddress | Export-Csv c:\temp\MailIndividuals.csv -NoTypeInformation

    Sending data to a remote command failed with the following error message: [ClientAccessServer=Server,BackEndServer=Server.domain.com,RequestId=ae19d427-ec42-4bff-a89b-bf25663abfe7,TimeStamp=11/8/2016 1:09:55 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: (Server.domain.com:String) [], PSRemotingTransportException
        + FullyQualifiedErrorId : JobFailure
        + PSComputerName        : Server.domain.com


    Gary Barber


    • Edited by G Barber Tuesday, November 8, 2016 5:19 PM
    Tuesday, November 8, 2016 5:19 PM

All replies

  • Hi.

    I hope this can help you.

    MaximumReceivedDataSizePerCommand

    Using Variables in Script Workflows

    Set-PSSessionConfiguration

    Set-PSSessionConfiguration -Name microsoft.exchange -MaximumReceivedDataSizePerCommandMB 20 -MaximumReceivedObjectSizeMB 20


    MCITP, MCSE. Regards, Oleg

    Tuesday, November 8, 2016 6:47 PM
  • Thanks Oleg, but I got an error when trying on the Exchange 2013 server in both Windows PowerShell and EMC.

    Set-PSSessionConfiguration : Session configuration "microsoft.exchange" was not found.


    Gary Barber

    Tuesday, November 8, 2016 7:01 PM
  • $PSOptions = New-PSSessionOption -MaximumReceivedDataSizePerCommand 1073741824 -MaximumReceivedObjectSize 1073741824 -IdleTimeout 43200000
    $UserCredential = Get-Credential
    $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri 
    http://FQDN/PowerShell/ -Authentication Kerberos -Credential $UserCredential –SessionOption $PSOptions
    Import-PSSession $Session

    Hmmm. May be this for Exchange 2013.


    MCITP, MCSE. Regards, Oleg

    Tuesday, November 8, 2016 7:23 PM
  • Is there a reason that you're piping Get-Contact into Get-MailContact? Why not just run Get-MailContact? 
    Tuesday, November 8, 2016 7:34 PM
  • Yes, it’s make sense. Get-MailContact chose only Exchange object.


    MCITP, MCSE. Regards, Oleg

    Tuesday, November 8, 2016 7:38 PM
  • Because I need to filter the users by the company field. There is no company field in Get-MailContacts but there is in Get-Contacts so I need to get the contact by company then get the rest of the data from Get-MailContacts so I can use the result to compare the strings to an import file from our parent company to know what new MailContacts to create.

    Gary Barber

    Tuesday, November 8, 2016 7:42 PM
  • Create mail enabled contacts in bulk

    MCITP, MCSE. Regards, Oleg

    Tuesday, November 8, 2016 7:51 PM
  • Thanks, I already do this for the import. The thing I am doing is exporting what I already have to compare against the bulk file so i don't get errors on duplicates.

    Gary Barber

    Tuesday, November 8, 2016 7:55 PM
  • It is not as clean as the single command on my original post but by creating a PS script and writing each entry to the file as it is found, the script completed with out the error.

    $users = Get-Contact -resultsize 20000 -Filter "Company -eq 'Company - Individuals'"
    foreach ($user in $users) 
    {
    $data = Get-MailContact -Anr $user.DisplayName | Select-Object DisplayName, Alias, PrimarySmtpAddress | Export-Csv –Append c:\temp\MailContacts.csv -NoTypeInformation
    }


    Gary Barber

    Tuesday, November 8, 2016 7:59 PM