I've installed the EWS API and I want to use it with Powershell...I've taken a sample code that works in VBScript for simple downloading an email from teh store and saving as a .MSG file. This works fine in VBScript, but when I run it in powershell it says a property is not settable on the com object...the following error :-
"Property 'Data' cannot be found on this object; make sure it exists and is settable"
The code is below :-
$EVAPI = New-Object -comobject EnterpriseVault.ContentManagementAPI -Strict
#Create new item
$EVITEM = $EVAPI.Item
#Set Archive ID
$EVITEM.ArchiveID = "1330E58127A6234469C258BAD9EF5C5321110000evserver"
#Set Saveset ID
$EVITEM.Id = "201206280910464~201203281231260000~Z~C10F18AA0191BF6058DC93BADE506FE1"
#Set path to save to
$EVITEM.Content.Data = "c:\temp\temp888.msg"
#Get email into path
The error is the line $EVITEM.Content.Data = "c:\temp\temp888.msg"...this works fine in VBScript though.
Going on from that, I don't actually want to download the file as a .msg file...but rather instruct EV to restore the item back into the users mailbox.