David-Barrett-MS / PowerShell-EWS-Scripts

A collection of PowerShell scripts that use EWS to perform actions against Exchange mailboxes
MIT License
119 stars 13 forks source link

Update Search-Appointments.ps1 #26

Closed David-Barrett-MS closed 11 months ago

David-Barrett-MS commented 1 year ago

Script needs updating to validate OAuth functionality and some other improvements. Also needs Wiki added.

tousifsawant commented 11 months ago

Hello David,

I have a questions, below is the script that i am running

$items = .\Update-FolderItems.ps1 -Mailbox $Mailbox -FolderPath "WellKnownFolderName.MsgFolderRoot" -ProcessSubfolders -Office365 -OAuth -OAuthTenantId $tenantId -OAuthClientId $clientId -OAuthRedirectUri $redirectUrl -OAuthSecretKey $secretKey -SearchFilter subject:Invoice -ListMatches

When i execute the command it gives me results of all the emails with subject consisting Invoice in it. I have tried multiple formats like "subject:Invoice" but still i get the all the emails with Invoice in their subject, can please advise.

David-Barrett-MS commented 11 months ago

That shows that the search filter is working as expected? https://learn.microsoft.com/en-us/exchange/client-developer/exchange-web-services/how-to-perform-an-aqs-search-by-using-ews-in-exchange#using-a-string-value-type

David-Barrett-MS commented 11 months ago

Also please raise a new issue rather than adding to an unrelated work item.