question

asifA-5465 avatar image
0 Votes"
asifA-5465 asked asifA-5465 answered

Outlook public folder - Powershell

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-server-powershell
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

asifA-5465 avatar image
0 Votes"
asifA-5465 answered

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

I can dynamically concatenate the string finally Invoke the string

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

asifA-5465 avatar image
0 Votes"
asifA-5465 answered asifA-5465 published

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@domain.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

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

asifA-5465 avatar image
0 Votes"
asifA-5465 answered asifA-5465 edited

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)

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.