none
EWS: How to modify PidTagDelegateFlags RRS feed

  • Question

  • Guys,

    I found interesting thing about [Microsoft.Exchange.WebServices.Data]::AddDelegates() method delivered with EWS (looks like a bug). Point is it doesn't set 'Delegate can see my private items' for clients using Outlook 2003. It works just perfect for Outlook 2007 and above. Another attribute ,'Delegate receives copy of meeting-related messages sent to me' seems to work just perfect for every client. Our problem is we have recently found that e-mails marked as private which were sent to shared mailboxes are not visible by Outlook clients - they are visible by OWA/webmail though.

    After doing some research I found it's because of AddDelegates() method which doesn't set PidTagDelegateFlags attribute. Below you find code I'm using to access PidTagDelegateFlags:

    PS C:\...> $localfreebusyitem.GetType()   '$localfreebusyitem points to 'LocalFreeBusy' item located in "Root container\Freebusy Data"
    
    IsPublic IsSerial Name     BaseType     
    -------- -------- ----     --------     
    True False EmailMessage    Microsoft.Exchange.WebServices.Data.Item
    
    $cmpName = new-object Microsoft.Exchange.WebServices.Data.ExtendedPropertyDefinition([Microsoft.Exchange.WebServices.Data.DefaultExtendedPropertySet]::PublicStrings,"PidTagDelegateFlags",[Microsoft.Exchange.WebServices.Data.MapiPropertyType]::String);
    
    $psPropertySet = new-object Microsoft.Exchange.WebServices.Data.PropertySet([Microsoft.Exchange.WebServices.Data.BasePropertySet]::FirstClassProperties)
    
    $psPropertySet.add($cmpName)
    
    $localfreebusyitem.Load($psPropertySet)
    
    $output = $null
    
    $localfreebusyitem.TryGetProperty($cmpName,[ref]$output)
    

     


    No matter what data type I use for $cmpName (Long,LongArray,String,StringArray), TryGetProperty always returns False.

    How can I read and modify that attribute?

    Thank you.

    regards,

    Seba

     

     



    Tuesday, August 16, 2011 4:56 PM

Answers

  • Hi,

    it looks like your property definition is wrong. The property does not live in the public strings property set.

    Use

    new ExtendedPropertyDefinition(0x686B, MapiPropertyType.IntegerArray)
    

    See http://msdn.microsoft.com/en-us/library/ee159435%28v=exchg.80%29.aspx for the property definition and http://msdn.microsoft.com/en-us/library/ee218829%28v=exchg.80%29.aspx for a description of the property.

    Kind regards,

    Henning

     

    • Marked as answer by SebaO Tuesday, August 16, 2011 7:18 PM
    Tuesday, August 16, 2011 5:26 PM

All replies

  • Hi,

    it looks like your property definition is wrong. The property does not live in the public strings property set.

    Use

    new ExtendedPropertyDefinition(0x686B, MapiPropertyType.IntegerArray)
    

    See http://msdn.microsoft.com/en-us/library/ee159435%28v=exchg.80%29.aspx for the property definition and http://msdn.microsoft.com/en-us/library/ee218829%28v=exchg.80%29.aspx for a description of the property.

    Kind regards,

    Henning

     

    • Marked as answer by SebaO Tuesday, August 16, 2011 7:18 PM
    Tuesday, August 16, 2011 5:26 PM
  • Thank you Henning! It worked.

     

     

    For those who might want to modify that prop...

    $output = ....

    $localfreebusyitem.SetExtendedProperty($cmpName,$output)

    $localfreebusyitem.Update(1)

     

    regards,

    Seba

    Tuesday, August 16, 2011 7:28 PM