Share via

Outlook public folder - Powershell

asif ahamed 201 Reputation points
2021-07-15T15:38:25.507+00:00

i have a PUBLIC FOLDER attached to my outlook. Is there a way I can query using powershell last received email? I don't want to go through message tracking log -received cmdlet because it takes a LOT OF TIME

Windows for business | Windows Server | User experience | PowerShell
0 comments No comments

Answer accepted by question author

asif ahamed 201 Reputation points
2021-07-15T22:26:23.34+00:00

$public_folders = $public_folder.folders.item("All Public Folders").folders.item("CAAP")

I can dynamically concatenate the string finally Invoke the string

Was this answer helpful?

0 comments No comments

2 additional answers

Sort by: Most helpful
  1. asif ahamed 201 Reputation points
    2021-07-15T17:55:44.507+00:00

    I think partially I got the answer but please tell me the below

    $public_folders = $public_folder.folders.item("All Public Folders")

    $public_CAAP = $public_folders.folders.item("CAAP")

    is there was I can consolidate the above two as

    $public_CAAP = $public_folders.folders.item("All Public Folders\CAAP") (it doesn't work I tried different way \ in front of All public folder)

    Was this answer helpful?

    0 comments No comments

  2. asif ahamed 201 Reputation points
    2021-07-15T17:06:25.673+00:00

    I am able to go up to here

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

    $Outlook = New-Object -comobject Outlook.Application

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

    $public_folder = $namespace.Folders.Item("Public Folders - myname@keyman .com")

    $public_folders = $public_folder.folders.item("All Public Folders")

    $public_CAAP = $public_folders.folders.item("CAAP")

    I would like to go recursively and find out the las received email and folder path. Please help me

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.