Find the length of an email attachment name.

This page summarizes the projects mentioned and recommended in the original post on /r/PowerShell

SurveyJS - Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App
With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
surveyjs.io
featured
InfluxDB - Power Real-Time Data Analytics at Scale
Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
www.influxdata.com
featured
  • msgraph-sdk-javascript

    Microsoft Graph client library for JavaScript

  • # Import the required modules Import-Module -Name AzureAD, Microsoft.Graph.Authentication, Microsoft.Graph.MailMessages -Force # Authenticate with MFA using the admin account $adminUsername = "XXXX.xxx" Connect-AzureAD -AccountUpn $adminUsername try { # Prompt for user's email address $userEmailAddress = Read-Host -Prompt "Enter the user's email address" # Get the user's emails with attachments $accessToken = Get-AzureADAccessToken -ResourceUrl "https://graph.microsoft.com" $graphClient = New-Object Microsoft.Graph.GraphServiceClient -ArgumentList ($accessToken.AccessToken) $emails = $graphClient.Users[$userEmailAddress].Messages.Request().Top(100).Filter("hasAttachments eq true").GetAsync().Result # Filter emails with attachments having names longer than 50 characters $longAttachments = $emails.Attachments | Where-Object { $_.Name.Length -gt 50 } # Output the attachments, subject, and date of the email if ($longAttachments.Count -gt 0) { Write-Host "Attachments with names longer than 50 characters for $userEmailAddress" foreach ($attachment in $longAttachments) { $email = $emails | Where-Object { $_.Attachments -contains $attachment } Write-Host "Subject: $($email.Subject)" Write-Host "Date: $($email.ReceivedDateTime.DateTime)" Write-Host "Attachment Name: $($attachment.Name)" Write-Host "" } } else { Write-Host "No attachments found with names longer than 50 characters for $userEmailAddress." } } catch { Write-Host "Failed to retrieve email attachments: $($_.Exception.Message)" } finally { # Disconnect from Azure AD Disconnect-AzureAD -Confirm:$false }

  • SurveyJS

    Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.

    SurveyJS logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • Container access to containers based on azure AD groups

    2 projects | /r/Traefik | 16 May 2023
  • Filtering app names that start with

    1 project | /r/PowerShell | 4 May 2023
  • Have you worked with Microsoft Graph API?

    1 project | /r/programming | 3 May 2023
  • Need some script helping - M365 API

    1 project | /r/PowerShell | 2 Mar 2023
  • AzureAD -filter string multiple values

    1 project | /r/PowerShell | 26 Jan 2023