Answered by:
EWS PowerShell view Autocomplete cache

Question
-
I'm trying to view the Outlook autocomplete cache via an EWS PowerShell script. The data is stored under Inbox (associated contents folder) > ipm.configuration.autocomplete > PR_ROAMING_BINARYSTREAM. I can access it using MCFmapi but don't know how to call an associated contents folder using EWS?
- Moved by Bill_Stewart Tuesday, November 5, 2019 3:55 PM Move to more appropriate forum
Answers
-
Associated contents can be accessed just like regular visible items - just specify Traversal="Associated" - https://docs.microsoft.com/en-us/previous-versions/office/developer/exchange-server-2010/dd633693(v%3Dexchg.80)
You can play with that in OutlookSpy - click GetFolder on the Outlook Spy ribbon (EWS group), go to the "Items (FindItem)" tab, change FindItem.Traversal combo box, click "Call FindItem".
Dmitry Streblechenko (MVP) http://www.dimastr.com/redemption
Redemption - what the Outlook
Object Model should have been
Version 5.5 is now available!
- Edited by Dmitry Streblechenko _MVP_MVP Tuesday, November 5, 2019 4:21 PM
- Proposed as answer by Just Karl Tuesday, November 5, 2019 4:26 PM
- Marked as answer by DPFY Tuesday, November 5, 2019 4:36 PM
All replies
-
Associated contents can be accessed just like regular visible items - just specify Traversal="Associated" - https://docs.microsoft.com/en-us/previous-versions/office/developer/exchange-server-2010/dd633693(v%3Dexchg.80)
You can play with that in OutlookSpy - click GetFolder on the Outlook Spy ribbon (EWS group), go to the "Items (FindItem)" tab, change FindItem.Traversal combo box, click "Call FindItem".
Dmitry Streblechenko (MVP) http://www.dimastr.com/redemption
Redemption - what the Outlook
Object Model should have been
Version 5.5 is now available!
- Edited by Dmitry Streblechenko _MVP_MVP Tuesday, November 5, 2019 4:21 PM
- Proposed as answer by Just Karl Tuesday, November 5, 2019 4:26 PM
- Marked as answer by DPFY Tuesday, November 5, 2019 4:36 PM
-
Thanks, I was able to do just that using this script - https://github.com/gscales/Powershell-Scripts/blob/master/EWS-FAI/Module/functions/FAI/List-FAIItems.ps1 .
But I still don't know how to get the text from the property PR_ROAMING_BINARYSTREAM . I need to script this so I can't really use OutlookSpy.
-
You can either use GetItem or specify that binary property in ItemShape.AdditionalProperties
Dmitry Streblechenko (MVP) http://www.dimastr.com/redemption
Redemption - what the Outlook
Object Model should have been
Version 5.5 is now available! -
Oh, and OutlookSpy is for figuring things out, not for using in your code.
Dmitry Streblechenko (MVP) http://www.dimastr.com/redemption
Redemption - what the Outlook
Object Model should have been
Version 5.5 is now available! -
-
I tried loading the BinaryStream but I get nothing back:
$ps = new-object Microsoft.Exchange.WebServices.Data.PropertySet([Microsoft.Exchange.WebServices.Data.BasePropertySet]::FirstClassProperties) $PR_ROAMING_BINARYSTREAM = new-object Microsoft.Exchange.WebServices.Data.ExtendedPropertyDefinition(0x0102, [Microsoft.Exchange.WebServices.Data.MapiPropertyType]::Binary) $ps.Add($PR_ROAMING_BINARYSTREAM) if ($fiItems.Items.Count -gt 0) { foreach($Item in $fiItems) { if($Item.ItemClass -match "IPM.Configuration") { $ItemClass = $Item.ItemClass $Subject = $Item.Subject if ($subject -eq "IPM.Configuration.Autocomplete") { $item.load($ps) Write-host "$itemclass" $list = $null [void]$item.TryGetProperty($PR_ROAMING_BINARYSTREAM, [ref]$list) write-host "$list" } } } }
It finds IPM.Configuration.Autocomplete but can't seem to load the binarystream. I looked at ItemShape.AdditionalProperties but couldn't find any working examples for PowerShell.
-
0x0102 is PT_BINARY. You want 0x7C09.
Dmitry Streblechenko (MVP) http://www.dimastr.com/redemption
Redemption - what the Outlook
Object Model should have been
Version 5.5 is now available! -