--- title: "Get-EmailMessageAttachment" slug: "scripting-get-emailmessageattachment" tags: ["Enterprise Only"] updated: 2025-07-16T20:32:55Z published: 2025-07-16T20:32:55Z canonical: "help.agilityblue.com/scripting-get-emailmessageattachment" --- > ## Documentation Index > Fetch the complete documentation index at: https://help.agilityblue.com/llms.txt > Use this file to discover all available pages before exploring further. # Get-EmailMessageAttachment ## Summary Retrieves an existing email message attachment. ```powershell Get-EmailMessageAttachment    -Id ``` Returns an [email message attachment](https://apidocs.agilityblue.com/#ac8fa01c-83b2-464c-b93f-865b271562b2) object. ## Parameters | Parameter | Type | Required? | Notes | | --- | --- | --- | --- | | Id | Int32 | Yes | The email message attachment id. | ## Examples ### Get an existing email message attachment This example retrieves a specific email message attachment and outputs it as JSON. ```powershell # Retrieve a specific email message attachment by id $emailMessageAttachment = Get-EmailMessageAttachment -Id 10 Write-Output "Retrieved email message attachment $($emailMessageAttachment.EmailMessageAttachmentId)" # Convert the email message attachment to output as JSON $jsonOutput = $emailMessageAttachment | ConvertTo-Json -Depth 10 # For debug purposes, convert the email message attachment to output as JSON so we can see the available fields Write-Output "" Write-Output "JSON Results:" $jsonOutput = $emailMessageAttachment | ConvertTo-Json -Depth 10 # Output the email message attachment Write-Output $jsonOutput ``` Execution results: ```plaintext Retrieved email message attachment 10 ``` JSON results: ```json {  "EmailMessageAttachmentId": 10,  "EmailMessageId": 15,  "EmailMessage": {    // Email message fields removed  },  "FileId": "30eb90c892c74033ab478a0bf1651c79",  "File": {    // File fields removed  },  "FileName": "blue_logo_square_144pxw_144pxh.png" } ```