Query outlook powershell

asif ahamed 201 Reputation points
2021-07-14T16:38:24.873+00:00

Add-Type -assembly "Microsoft.Office.Interop.Outlook"

$Outlook = New-Object -ComObject Outlook.Application

$Namespace = $Outlook.GetNameSpace("MAPI")

$NameSpace.Folders.Item(2) | Select FolderPath

When I run the above I get folder path \MyFolder - myname@domail.com

but I want to search all the folder recursive get the RECEIVED time. Please help me

Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,381 questions
{count} votes

Accepted answer
  1. Rich Matheisen 45,091 Reputation points
    2021-07-15T14:40:28.32+00:00

    There are plenty of examples to be found if you look for them. You can use the Outlook COM object or you can use Exchange Web Services to do this.

    372093-script-to-extract-all-senders-and-subjects-of-messages-in-a-specified-mailbox
    372093-script-to-extract-all-senders-and-subjects-of-messages-in-a-specified-mailbox
    viewthread.cfm

    0 comments No comments

0 additional answers

Sort by: Most helpful