Quantcast
Channel: Exchange Server Development forum
Viewing all articles
Browse latest Browse all 7132

[E2010][EWSMA][PS] Creating new Extended Properties

$
0
0

Hello fellow forum-dwellers,

once again I come with a question. I'm looking into creating extended Properties. My research so far can best be shown in code, I think:

# Create new definition
$extProp = New-Object Microsoft.Exchange.WebServices.Data.ExtendedPropertyDefinition([Microsoft.Exchange.WebServices.Data.DefaultExtendedPropertySet]::PublicStrings,"Test",[Microsoft.Exchange.WebServices.Data.MapiPropertyType]::String)

# Set custom property upon appointment
$Appointment.SetExtendedProperty($extProp,"TestValue")

# Do other things ...

# Read the property
if($Appointment.TryGetProperty($extProp,[ref]$temp)){Write-Host "Test: "$temp}

Now this would be all fine, if it just worked. Given my naturally suspicious nature (and recent headaches with EWS) I'm assuming I'm messing up in the ExtendedPropertyDefinition somehow (Like maybe trying to write into a standard property named "Test" which just so happens to not exist).

Any ideas how to make it work?

Regards,
Fred


Viewing all articles
Browse latest Browse all 7132

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>