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

EWS java - Specify the time zone when instantiate the ExchangeService object or Reply/Forward the email message.

$
0
0

I'm using ews-java-api-2.0.jar in my project. I want to specify EST zone. How this can be done in java api? Something like this.

C# code

ExchangeService service = new ExchangeService(TimeZoneInfo.FindSystemTimeZoneById("Eastern Standard Time"));

Or when I create a reply to an email message the DateTimeReceived on the original mail is incorrect, How can I force the reply code to use EST time zone.

PropertySet propertySet = new PropertySet(BasePropertySet.IdOnly,
            EmailMessageSchema.From, EmailMessageSchema.CcRecipients,
            EmailMessageSchema.Subject, EmailMessageSchema.Body,
            EmailMessageSchema.Sender, EmailMessageSchema.DateTimeReceived,
            EmailMessageSchema.Attachments);

    propertySet.setRequestedBodyType(BodyType.HTML);

    String itemId = emailMessage.getId().toString();
    EmailMessage message = EmailMessage.bind(service, new ItemId(itemId), propertySet);
    //message.getIsTimeZoneHeaderRequired(true);
    //getESTTimeZone(service);
    MessageBody errorMessage = new MessageBody();
    errorMessage.setBodyType(BodyType.HTML);
    errorMessage.setText(returnMessage);
    message.reply(errorMessage, false);   //false means do not reply all


EWS .NET API: Invalid named property error when setting an extended property to EmailMessage object

$
0
0

Hi,

I am using EWS .NET API.

When I try to set extended property using either default property set or my custom GUID as property set Id in the .NET code, I receive error 'An internal server error occurred. The operation failed., Invalid named property: [{1ea5aebe-567f-44c7-8b26-936bf90ea5fd}:'PropertyName'] GuidName_PropertyName'.

The mail box is on Office 365.

This error is occurring to a specific mail box. The code works well for other mail boxes.

With regards,

Pinakin

Mount Points Best Practise

$
0
0

Our Exchange 2013 Mailbox servers currently have a D: drive and within this D drive there are Netapp mount points which hold the database.

So for example:

D:\Mountpoints\database1

D:\Mountpoints\database2

My question is, is this really best practice? My conern is that if the D drive goes down, we loose all our database. I'm thinking it may be a better approach to present the mount points as actual disk drives to the VM. so F: holds database1 G: database2 etc...

Just wanted to get some opinions on this.


Thanks

Looking for a script that can apply a retention tag to a custom folder.

$
0
0

Hi anyone know of a script that can apply a retention tag on a custom folder? We are migrating from Exchange 2013 to o365.  Currently we are using Enterprise Vault to handle all retention of emails.  When moving mailboxes to the cloud we need to be able to apply the Exchange retention tags to a folder that is in every users mailbox.  Anyone know of a script that can do this?  Microsoft left us hanging when they remove the managed folders tools in 2010.  The folder that I need to this to is a custom folder and we need to place a retention tag of 10 years on the folder during or before the migrations.  Thanks!

How does XSL process

$
0
0

I'm new to XSL and having difficulty in understanding how/when patterns match/process. I understand that it is declarative, not procedural, and am at the disadvantage of trying to process XML -> XML, not XML -> HTML (which is what all the tutorials appear to show). In essence I want to sort a subtree of my XML file (which is a Visual studio document). In the subtree I want to sort the sibilngs by an attribute. A truncated sample of the file is:

<?xml version="1.0"?><SqlWorkbenchSqlProject xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Name="PMISQL"><Items><LogicalFolder Name="Connections" Type="2" Sorted="true"><Items><ConnectionNode Name="cerberus:XPOOLE\alistair.moreton"><Created>2013-06-28T15:50:27.919788+01:00</Created><Type>SQL</Type><Server>cerberus</Server><UserName /><Authentication>Windows Authentication</Authentication><InitialDB>master</InitialDB><LoginTimeout>15</LoginTimeout><ExecutionTimeout>0</ExecutionTimeout><ConnectionProtocol>NotSpecified</ConnectionProtocol><ApplicationName>Microsoft SQL Server Management Studio - Query</ApplicationName></ConnectionNode><ConnectionNode Name="hector:XPOOLE\alistair.moreton"><Created>2013-07-02T15:27:02.5793203+01:00</Created><Type>SQL</Type><Server>hector</Server><UserName /><Authentication>Windows Authentication</Authentication><InitialDB /><LoginTimeout>15</LoginTimeout><ExecutionTimeout>0</ExecutionTimeout><ConnectionProtocol>NotSpecified</ConnectionProtocol><ApplicationName>Microsoft SQL Server Management Studio - Query</ApplicationName></ConnectionNode></Items></LogicalFolder><LogicalFolder Name="Queries" Type="0" Sorted="true"><Items><FileNode Name="PMI001_AddressHistory.sql"><AssociatedConnectionMoniker>8c91a03d-f9b4-46c0-a305-b5dcc79ff907:cerberus:True</AssociatedConnectionMoniker><AssociatedConnSrvName>cerberus</AssociatedConnSrvName><AssociatedConnUserName /><FullPath>PMI001_AddressHistory.sql</FullPath></FileNode><FileNode Name="PMI000_DataWarehouseState.sql"><AssociatedConnectionMoniker>8c91a03d-f9b4-46c0-a305-b5dcc79ff907:hector:True</AssociatedConnectionMoniker><AssociatedConnSrvName>hector</AssociatedConnSrvName><AssociatedConnUserName /><FullPath>PMI000_DataWarehouseState.sql</FullPath></FileNode><FileNode Name="PMI003_PlannedAdmissions.sql"><AssociatedConnectionMoniker>8c91a03d-f9b4-46c0-a305-b5dcc79ff907:cerberus:True</AssociatedConnectionMoniker><AssociatedConnSrvName>cerberus</AssociatedConnSrvName><AssociatedConnUserName /><FullPath>PMI003_PlannedAdmissions.sql</FullPath></FileNode><FileNode Name="PMI004_AllActivity.sql"><AssociatedConnectionMoniker>8c91a03d-f9b4-46c0-a305-b5dcc79ff907:cerberus:True</AssociatedConnectionMoniker><AssociatedConnSrvName>cerberus</AssociatedConnSrvName><AssociatedConnUserName /><FullPath>PMI004_AllActivity.sql</FullPath></FileNode><FileNode Name="PMI002_ClinicCodes.sql"><AssociatedConnectionMoniker>8c91a03d-f9b4-46c0-a305-b5dcc79ff907:cerberus:True</AssociatedConnectionMoniker><AssociatedConnSrvName>cerberus</AssociatedConnSrvName><AssociatedConnUserName /><FullPath>PMI002_ClinicCodes.sql</FullPath></FileNode></Items></LogicalFolder><LogicalFolder Name="Miscellaneous" Type="3" Sorted="true"><Items /></LogicalFolder></Items><SccProjectName>$/DataWarehouse/Dev/Reports/PMI</SccProjectName><SccAuxPath /><SccLocalPath>.</SccLocalPath><SccProvider>MSSCCI:Team Foundation Server MSSCCI Provider</SccProvider></SqlWorkbenchSqlProject>

and the XSL file I'm applying is:

<?xml version="1.0" encoding="iso-8859-1"?><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"><xsl:template match="/"><xsl:copy-of select="."/><xsl:apply-templates/></xsl:template><xsl:template match="/SqlWorkbenchSqlProject/Items/LogicalFolder[Name='Connections']"><xsl:copy-of select="."/></xsl:template><xsl:template match="/SqlWorkbenchSqlProject/Items/LogicalFolder[Name='Queries']"><xsl:copy-of select="."/></xsl:template><xsl:template match="/SqlWorkbenchSqlProject/Items/LogicalFolder[Name='Queries']/Items"><xsl:for-each select="./FileNode"><xsl:sort select="@Name" data-type="text" case-order="upper-first"/><xsl:copy-of select="."/></xsl:for-each></xsl:template><xsl:template match="/SqlWorkbenchSqlProject/Items/LogicalFolder[Name='Miscellaneous']"><xsl:copy-of select="."/></xsl:template></xsl:stylesheet>

I want to sort the FileNode siblings in /SqlWorkbenchSqlProject/Items/LogicalFolder where Name="Queries" by their @Name attribute, but I want the rest of the file to be output as it is.

If I run the transform above, I get additional junk at the end of the file, i.e.:

<?xml version="1.0" encoding="utf-8"?><SqlWorkbenchSqlProject Name="PMISQL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><Items><LogicalFolder Name="Connections" Type="2" Sorted="true"><Items><ConnectionNode Name="cerberus:XPOOLE\alistair.moreton"><Created>2013-06-28T15:50:27.919788+01:00</Created><Type>SQL</Type><Server>cerberus</Server><UserName /><Authentication>Windows Authentication</Authentication><InitialDB>master</InitialDB><LoginTimeout>15</LoginTimeout><ExecutionTimeout>0</ExecutionTimeout><ConnectionProtocol>NotSpecified</ConnectionProtocol><ApplicationName>Microsoft SQL Server Management Studio - Query</ApplicationName></ConnectionNode><ConnectionNode Name="hector:XPOOLE\alistair.moreton"><Created>2013-07-02T15:27:02.5793203+01:00</Created><Type>SQL</Type><Server>hector</Server><UserName /><Authentication>Windows Authentication</Authentication><InitialDB /><LoginTimeout>15</LoginTimeout><ExecutionTimeout>0</ExecutionTimeout><ConnectionProtocol>NotSpecified</ConnectionProtocol><ApplicationName>Microsoft SQL Server Management Studio - Query</ApplicationName></ConnectionNode></Items></LogicalFolder><LogicalFolder Name="Queries" Type="0" Sorted="true"><Items><FileNode Name="PMI001_AddressHistory.sql"><AssociatedConnectionMoniker>8c91a03d-f9b4-46c0-a305-b5dcc79ff907:cerberus:True</AssociatedConnectionMoniker><AssociatedConnSrvName>cerberus</AssociatedConnSrvName><AssociatedConnUserName /><FullPath>PMI001_AddressHistory.sql</FullPath></FileNode><FileNode Name="PMI000_DataWarehouseState.sql"><AssociatedConnectionMoniker>8c91a03d-f9b4-46c0-a305-b5dcc79ff907:hector:True</AssociatedConnectionMoniker><AssociatedConnSrvName>hector</AssociatedConnSrvName><AssociatedConnUserName /><FullPath>PMI000_DataWarehouseState.sql</FullPath></FileNode><FileNode Name="PMI003_PlannedAdmissions.sql"><AssociatedConnectionMoniker>8c91a03d-f9b4-46c0-a305-b5dcc79ff907:cerberus:True</AssociatedConnectionMoniker><AssociatedConnSrvName>cerberus</AssociatedConnSrvName><AssociatedConnUserName /><FullPath>PMI003_PlannedAdmissions.sql</FullPath></FileNode><FileNode Name="PMI004_AllActivity.sql"><AssociatedConnectionMoniker>8c91a03d-f9b4-46c0-a305-b5dcc79ff907:cerberus:True</AssociatedConnectionMoniker><AssociatedConnSrvName>cerberus</AssociatedConnSrvName><AssociatedConnUserName /><FullPath>PMI004_AllActivity.sql</FullPath></FileNode><FileNode Name="PMI002_ClinicCodes.sql"><AssociatedConnectionMoniker>8c91a03d-f9b4-46c0-a305-b5dcc79ff907:cerberus:True</AssociatedConnectionMoniker><AssociatedConnSrvName>cerberus</AssociatedConnSrvName><AssociatedConnUserName /><FullPath>PMI002_ClinicCodes.sql</FullPath></FileNode></Items></LogicalFolder><LogicalFolder Name="Miscellaneous" Type="3" Sorted="true"><Items /></LogicalFolder></Items><SccProjectName>$/DataWarehouse/Dev/Reports/PMI</SccProjectName><SccAuxPath /><SccLocalPath>.</SccLocalPath><SccProvider>MSSCCI:Team Foundation Server MSSCCI Provider</SccProvider></SqlWorkbenchSqlProject>




          2013-06-28T15:50:27.919788+01:00
          SQL
          cerberus

          Windows Authentication
          master
          15
          0
          NotSpecified
          Microsoft SQL Server Management Studio - Query


          2013-07-02T15:27:02.5793203+01:00
          SQL
          hector

          Windows Authentication

          15
          0
          NotSpecified
          Microsoft SQL Server Management Studio - Query






          8c91a03d-f9b4-46c0-a305-b5dcc79ff907:cerberus:True
          cerberus

          PMI001_AddressHistory.sql


          8c91a03d-f9b4-46c0-a305-b5dcc79ff907:hector:True
          hector

          PMI000_DataWarehouseState.sql


          8c91a03d-f9b4-46c0-a305-b5dcc79ff907:cerberus:True
          cerberus

          PMI003_PlannedAdmissions.sql


          8c91a03d-f9b4-46c0-a305-b5dcc79ff907:cerberus:True
          cerberus

          PMI004_AllActivity.sql


          8c91a03d-f9b4-46c0-a305-b5dcc79ff907:cerberus:True
          cerberus

          PMI002_ClinicCodes.sql







  $/DataWarehouse/Dev/Reports/PMI

  .
  MSSCCI:Team Foundation Server MSSCCI Provider

So:

(a) any idea how I modify the transform to achieve my aim and why, and

(b) where is the junk coming from. I have no XSL nodes that are xsl:value-of, so why are values being output for nodes that have already been processed, and (yes, and),

(c) in general, if I want to generate as output, the input file, except for a subtree that I want to treat differently, how do I go about this?

Any help will be very much appreciated. If I'm in the wrong forum, please point me in the right direction. The Visual Studio forums I've posted in before appear to no longer be.

Many thanks,

Mark


Looking for a script that can apply a retention tag to a custom folder.

$
0
0

Hi anyone know of a script that can apply a retention tag on a custom folder? We are migrating from Exchange 2013 to o365.  Currently we are using Enterprise Vault to handle all retention of emails.  When moving mailboxes to the cloud we need to be able to apply the Exchange retention tags to a folder that is in every users mailbox.  Anyone know of a script that can do this?  Microsoft left us hanging when they remove the managed folders tools in 2010.  The folder that I need to this to is a custom folder and we need to place a retention tag of 10 years on the folder during or before the migrations.  Thanks!

"1635" error code during installation update rollup 22 for Exchange Server 2007 SP3

$
0
0

Hello

I could not go through this problem:

=== Verbose logging started: 12.1.2017  9:27:42  Build type: SHIP UNICODE 4.05.6002.00  Calling process: C:\Windows\System32\msiexec.exe ===
MSI (c) (40:60) [09:27:42:964]: Resetting cached policy values
MSI (c) (40:60) [09:27:42:964]: Machine policy value 'Debug' is 0
MSI (c) (40:60) [09:27:42:964]: ******* RunEngine:
           ******* Product: {24B2C164-DE66-44FE-B468-A46D9D5E6B31}
           ******* Action:
           ******* CommandLine: **********
MSI (c) (40:60) [09:27:42:965]: Machine policy value 'DisableUserInstalls' is 0
MSI (c) (40:60) [09:27:42:986]: Cloaking enabled.
MSI (c) (40:60) [09:27:42:986]: Attempting to enable all disabled privileges before calling Install on Server
MSI (c) (40:60) [09:27:42:991]: End dialog not enabled
MSI (c) (40:60) [09:27:42:991]: Original package ==> C:\Windows\Installer\158b5f.msi
MSI (c) (40:60) [09:27:42:991]: Package we're running from ==> C:\Windows\Installer\158b5f.msi
MSI (c) (40:60) [09:27:43:063]: APPCOMPAT: looking for appcompat database entry with ProductCode '{24B2C164-DE66-44FE-B468-A46D9D5E6B31}'.
MSI (c) (40:60) [09:27:43:063]: APPCOMPAT: no matching ProductCode found in database.
MSI (c) (40:60) [09:27:43:065]: MSCOREE not loaded loading copy from system32
MSI (c) (40:60) [09:27:43:084]: Opening existing patch 'C:\Windows\Installer\331b1307.msp'.
MSI (c) (40:60) [09:27:43:085]: Opening existing patch 'C:\Windows\Installer\98100af.msp'.
MSI (c) (40:60) [09:27:43:087]: Opening existing patch 'C:\Windows\Installer\47113fc.msp'.
MSI (c) (40:60) [09:27:43:088]: Opening existing patch 'C:\Windows\Installer\2be44c14.msp'.
MSI (c) (40:60) [09:27:43:090]: Opening existing patch 'C:\Windows\Installer\64662ba7.msp'.
MSI (c) (40:60) [09:27:43:091]: Opening existing patch 'C:\Windows\Installer\7492ef7.msp'.
MSI (c) (40:60) [09:27:43:092]: Opening existing patch 'C:\Windows\Installer\3a7d1c3c.msp'.
MSI (c) (40:60) [09:27:43:094]: Opening existing patch 'C:\Windows\Installer\131877.msp'.
MSI (c) (40:60) [09:27:43:096]: Opening existing patch 'C:\Windows\Installer\596aeab4.msp'.
MSI (c) (40:60) [09:27:43:098]: Opening existing patch 'C:\Windows\Installer\5143961d.msp'.
MSI (c) (40:60) [09:27:43:099]: Opening existing patch 'C:\Windows\Installer\2cb44321.msp'.
MSI (c) (40:60) [09:27:43:100]: Note: 1: 2262 2: SummaryInformation 3: -2147287038
MSI (c) (40:60) [09:27:43:100]: Note: 1: 2262 2: _StringPool 3: -2147287038
MSI (c) (40:60) [09:27:43:100]: Note: 1: 2219 2:  3:  4:  
MSI (c) (40:60) [09:27:43:100]: PATCH SEQUENCER ERROR: could not open database for {E9730840-6730-446B-BBAE-1866F024031E} patch! (1: 2219 2:  3:  4:  )
This update package could not be opened. Verify that the update package exists and that you can access it, or contact the application vendor to verify that this is a valid Windows Installer update package.
C:\Windows\Installer\158b5f.msi
MSI (c) (40:60) [09:27:43:101]: Note: 1: 1708
MSI (c) (40:60) [09:27:43:101]: Product: Microsoft Exchange Server -- Installation failed.

MSI (c) (40:60) [09:27:43:102]: Windows Installer installed the product. Product Name: Microsoft Exchange Server. Product Version: 8.3.83.6. Product Language: 1033. Installation success or error status: 1635.

MSI (c) (40:60) [09:27:43:111]: MainEngineThread is returning 1635
=== Verbose logging stopped: 12.1.2017  9:27:43 ===

Can anyone help me, please?

I cannot find source for 158b5F.msi, is it from SP3 or first installation...

Thank you very much

Exchange / Outlook and Domino mails synchronization

$
0
0

I would like to synchronize two mail systems. My users have :
1. A first  mailbox "@domain.com" on Exchange Cloud.
2. A second mailbox "@domain2.com" on Domino On Premise, accessible only read only.

They use only Exchange mailbox to send and receive mails.
What i would like to do :

  1. When they receive a mail on Exchange, the mail is automatically
    transferred on Domino mailbox. That point is easy with a redirect rule,
    works with Outlook and OWA.

  2. When they send a mail, the mail is automattically tansferred on
    Domino mailbox as send element or the mail subject is tagged (like [SEND
    ELEMENT] Subject) and transferred in their inbox.

The second case doesn't work with OWA, wich does not allow sending rules.

Is someone have an idea about this issue or is there a tool to do this ?

Thanks!


Microsoft EWS setting extended property of type Currency

$
0
0

Currently I have a Exchange public folder that has assigned Custom Form. One of the many user defined fields on the form is set to be of Currency. For some reason doesn't matter what I do, I can't set Currency field pragmatically.

I have created a separate folder and simple custom form where one field is of type Currency as below:

Then I am able to create Post Item and save it to the folder that has test custom form assigned but unfortunately I can't seems to set TestCurrency extended property:

var postItem =newPostItem(service){ItemClass="IPM.Post.EWSTestingForm",Subject="Testing Custom Forms"};

postItem.SetExtendedProperty(newExtendedPropertyDefinition(DefaultExtendedPropertySet.PublicStrings,"TestText",MapiPropertyType.String),"TestTextValue");
postItem.SetExtendedProperty(newExtendedPropertyDefinition(DefaultExtendedPropertySet.PublicStrings,"TestCurrency",MapiPropertyType.Currency),1200.000);
postItem.Save(ewsFolderUniqueId);

Do Currency extended property fields need special treatments? All other fields seem to work (text, booleans etc)

[E2010][MAPI] New CAS server leads to MAPI_E_FAILONEPROVIDER and RPC log failure

$
0
0

One of our customers has trouble to use MFCMAPI with the latest ExchangeMAPI package to access a mailbox on Exchange 2010 after a new CAS server was installed an the old one was deinstalled. The mailbox server stayed the same and has no CAS role installed.

We recreated the MAPI profile for the mailbox to select the new CAS server. "Check names" resolved successfully.
But still MAPI_E_FAILONEPROVIDER when we try to open the mailbox hierarchie from MFCMAPI.

We created a CAS array with just one member. Still same error.

Accessing the CAS through https:// showed no certificate problems

We logged on with that user on a client machine with Outlook 2010 and had no troubles to access the mailbox.

Digging the RPC client access logs on the new CAS showed this error:

User SID: S-... can't act as owner of a UserMailbox object ...

We looked up the SID and found that it was the SID of the domain admin not the currently logged on user.

Granting the domain admin fullaccess on the mailbox allowed us to connect.

But why would the admin-account be used for logon when our MAPI profile should use Windows Integrated Security which should use the locally logged on account?

We checked IIS app pools: they are either set to use LocalSystem or ApplicationPoolIdentity. No sign of domain-admin.

The rpc app has only Windows Authentication enabled.


-- SvenC

Exchange 2010 : error while creating new send connector

$
0
0

active directory operation failed on SRV-Domain.local This error is not retriable. Additional information: The name reference is invalid. This may be caused by replication latency between active directory domain controllers.

What is this sequence number generated?

$
0
0

Hi,

We have configured our exchange server to send out email to another mail server. So prior to an email getting delivered in the room mailbox. We've created an smtp send connector, and set the target ip address for this requirement.

Here is a screenshot of smtp logs taken from the target server...

Notice the highlighted line. The room mailbox address is actually 21.12P1567@contoso.com

However that is not what appears in a RCPT handshake. Why does it happen like this? What is that sequence number getting prefixed prior to the mail id. Plus, why is the mail id saying<machine_name>.contoso.com as the domain?

Any setting to change this? Hope I've posted this in the correct forum. If not please show me the correct forum.


I am a bundle of mistakes intertwined together with good intentions


[E2010][MAPI] New CAS server leads to MAPI_E_FAILONEPROVIDER and RPC log failure

$
0
0

One of our customers has trouble to use MFCMAPI with the latest ExchangeMAPI package to access a mailbox on Exchange 2010 after a new CAS server was installed an the old one was deinstalled. The mailbox server stayed the same and has no CAS role installed.

We recreated the MAPI profile for the mailbox to select the new CAS server. "Check names" resolved successfully.
But still MAPI_E_FAILONEPROVIDER when we try to open the mailbox hierarchie from MFCMAPI.

We created a CAS array with just one member. Still same error.

Accessing the CAS through https:// showed no certificate problems

We logged on with that user on a client machine with Outlook 2010 and had no troubles to access the mailbox.

Digging the RPC client access logs on the new CAS showed this error:

User SID: S-... can't act as owner of a UserMailbox object ...

We looked up the SID and found that it was the SID of the domain admin not the currently logged on user.

Granting the domain admin fullaccess on the mailbox allowed us to connect.

But why would the admin-account be used for logon when our MAPI profile should use Windows Integrated Security which should use the locally logged on account?

We checked IIS app pools: they are either set to use LocalSystem or ApplicationPoolIdentity. No sign of domain-admin.

The rpc app has only Windows Authentication enabled.


-- SvenC

Exchange 2013 - Disabled Mailbox not showing up immediately in the Connect a Mailbox

$
0
0

I have disable a mailbox  over an hour ago but it doesn’t show in the connect a mailbox section in the ECP Exchange 2013. immediately. The reason why I disable the email as I want to attach it to a new AD user which I have created.

I know you have to wait for replication so it appears in the connect a mailbox but I’m not sure how long and we forced an AD replication to see if that works.

I know with Exchange 2010, to get the disconnected mailbox to show immediately, I used to write a command Clean-MailboxDatabase “DB” to get it to appear in the disconnected mailbox but that doesn’t work with Exchange 2013 anymore.

Anyone have any suggestions?

exchange 2013 sp1 ews - cannot bind to folder

$
0
0

Hi,

Trying to use Glen Scales excellent code from here: http://gsexdev.blogspot.co.uk/2012/01/ews-managed-api-and-powershell-how-to_23.html

to bind to a folder - in fact, the inbox. 

$MailboxName = 'user@vanity.domain' # this is in fact the primary SMTP address, although it doesn't match the domain of the exchange server

$ExchangeVersion = [Microsoft.Exchange.WebServices.Data.ExchangeVersion]::Exchange2013_SP1  

$service = New-Object Microsoft.Exchange.WebServices.Data.ExchangeService($ExchangeVersion)  

$psCred = Get-Credential  

$creds = New-Object System.Net.NetworkCredential($psCred.UserName.ToString(),$psCred.GetNetworkCredential().password.ToString())  

$service.Credentials = $creds

$uri=[system.URI] "https://ews.servername.domain/ews/exchange.asmx"  

$service.Url = $uri  

$folderid = New-Object Microsoft.Exchange.WebServices.Data.folderid([Microsoft.Exchange.WebServices.Data.WellKnownFolderName]::inbox,$MailboxName)

$inbox = [Microsoft.Exchange.WebServices.Data.Folder]::Bind($service,$folderid)


and the result is:

Exception calling "Bind" with "2" argument(s): "The request failed. The remote server returned an error: (404) Not Found."
At C:\scratch\bloomers email stuff\scratch.ps1:87 char:1
+ $inbox = [Microsoft.Exchange.WebServices.Data.Folder]::Bind($service,$folderid)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : ServiceRequestException

i've used ewseditor to validate the service url and mailbox name; i can get in and bind to the folder there using the service.url and mailbox name i'm passing in the code, and the credentials i enter, but when i try and run it in powershell i keep getting the 404.

it's possibly worth noting that the exchange sits in a resource domain, so the credentials i am passing are for user.domain.local, not resource.domain.local, and the email address is in vanity.domain.com.  sigh. none of that is my choosing.

i'm sure this is a schoolboy error, but it's now 7pm on a saturday night, and i've been knocking my head on the wall with this for the last 48 hours... sorry. and thanks.



Where to start?

$
0
0

We are looking to develop a security-based product that monitors our internal Office365 exchange users.

Use Case:  A service runs on one of our servers, connects to Office365 with administrator privileges, iterates over the users, iterates over their mailbox folders, and parses found email messages.

We found some API information about Office365 for email access, but that appears to be for individual users.  As I understand it, this is useful if you're creating an application that gets installed at the user level; however, we do not want to install the service on all of the user systems.  The solution needs to have admin level access to all users centrally, not run from individual user accounts.

I'm not sure where to start reading - any help is greatly appreciated.

Searching by DisplayName filed with ContainsSubstring filter does not work

$
0
0

Hi,
I am using Office365 and EWS for searching contacts in the WellKnownFolderName.Contacts folder (Microsoft.Exchange.WebServices.Data.Folder.FindItems(SearchFilter searchFilter, ItemView view)).
I am trying to find and to filter contacts with SearchFilter.ContainsSubstring filter by display name (ContactSchema.DisplayName) field,
but somehow it use ContainmentMode.PrefixOnWords filter for DisplayName.
I have no this problem with ContactSchema.GivenName, ContactSchema.MiddleName, ContactSchema.Surname fileds.
The "ContainsSubstring" filters works fine for these fields, but not for DisplayName.

If I try to search by all fields together ContactSchema.GivenName, ContactSchema.MiddleName, ContactSchema.Surname and ContactSchema.DisplayName with SearchFilter.ContainsSubstring filter,
then SearchFilter.ContainsSubstring are replaced with ContainmentMode.PrefixOnWords for all fields!

so, there are questions I have
1. Why the ContainsSubstring filter (with ContainmentMode.Substring) does not work for DisplayName?
2. Why ContainsSubstring does not work for any field when ContainsSubstring filter are presented for DisplayName?

Thanks

exchange 2013 sp1 ews - using extended mapi properties

$
0
0

Hi All,

trying to use extended mapi properties. i've been asked to sort out a way of returning all items in an inbox that are not replied to or forwarded after 48 hours, by category. i'm working my way through Glen Scales' examples on his great blog, here:

http://gsexdev.blogspot.co.uk/2012/02/ews-managed-api-and-powershell-how-to.html

 th mapi property i want to use is PR_LAST_VERB_EXECUTED

https://msdn.microsoft.com/en-us/library/office/cc841968.aspx

but i am struggling, somewhat. this is the (working) code i've got to retrieve an extended mapi property for a mail item in the inbox:

$inbox = [Microsoft.Exchange.WebServices.Data.Folder]::Bind($service,$folderid)


	 $psPropset = new-object Microsoft.Exchange.WebServices.Data.PropertySet([Microsoft.Exchange.WebServices.Data.BasePropertySet]::FirstClassProperties)
	 $PidTagSubject = new-object Microsoft.Exchange.WebServices.Data.ExtendedPropertyDefinition(0x0037,[Microsoft.Exchange.WebServices.Data.MapiPropertyType]::string);
	 $psPropSet.Add($PidTagSubject)




    #Define ItemView to retrive just 10 Items
	 $ivItemView =  New-Object Microsoft.Exchange.WebServices.Data.ItemView(10)
	 $fiItems = $service.FindItems($Inbox.Id,$ivItemView)
	 [Void]$service.LoadPropertiesForItems($fiItems,$psPropset)
	 foreach($Item in $fiItems.Items){
	     "RecivedDate : " + $Item.DateTimeReceived"Subject     : " + $Item.Subject"category    : " + $Item.categories

	$msMessage = [Microsoft.Exchange.WebServices.Data.EmailMessage]::Bind($service,$Item.Id,$psPropSet)

	$SubjectVal = $null
	if($msmessage.TryGetProperty($PidTagSubject,[ref]$SubjectVal)){
     "Extended Property : " + $SubjectVal
	 }



}  

works perfectly; it outputs exactly what you'd expect:

RecivedDate : 01/15/2017 19:25:45
Subject     : red item 2
category    : Red category
Extended Property : red item 2

well yeah, it would; it's just Glen's code.

when i edit it to retrieve the property i want, i get a fail. i change the line that defines $PidTagSubject to:

$PidTagSubject = new-object Microsoft.Exchange.WebServices.Data.ExtendedPropertyDefinition(0x1081,[Microsoft.Exchange.WebServices.Data.MapiPropertyType]::Long); 

and i get:

RecivedDate : 01/15/2017 19:25:45
Subject     : red item 2
category    : Red category
Exception calling "Bind" with "3" argument(s): "The extended property attribute combination is invalid."
At C:\Users\administrator.EX2K13LONE\Documents\scratchewsold.ps1:50 char:2
+     $msMessage = [Microsoft.Exchange.WebServices.Data.EmailMessage]::Bind($service, ...
+    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : ServiceResponseException

now using mfcmapi i can see that the property is as follows:

so i would expect the returned extended mapi property to be "102"...

what am i doing wrong?


Modify PidLidAppointmentStateFlags

$
0
0

Hi community,

we have a new question related to the modification of Named properties.

We need to modify the PidLidAppointmentStateFlags value and set it to  asfMeeting | asfReceived ( 3).

When we update its value, we get the following error:Item save operation did not succeed.

            var myPropertySetId2 = new Guid("00062002-0000-0000-C000-000000000046");
            var extendedPropertyDefinition13 = new ExtendedPropertyDefinition(DefaultExtendedPropertySet.Appointment, 0x8217, MapiPropertyType.Integer);  // PidLidAppointmentStateFlags, ,
            //  var extendedPropertyDefinition13 = new ExtendedPropertyDefinition(myPropertySetId2, 0x8217, MapiPropertyType.Integer);  // PidLidAppointmentStateFlags, ,

            appointment = Appointment.Bind(_Service, new ItemId(nmResp.ItemId.Id), new PropertySet(extendedPropertyDefinition13));
            var val13 = 3;
            appointment.SetExtendedProperty(extendedPropertyDefinition13, val13);
            appointment.Update(ConflictResolutionMode.AlwaysOverwrite, SendInvitationsOrCancellationsMode.SendToNone);

Initially the value is 0 and we manage to set it to 1 or revert to 0. We're not able to set it to 3.

However, using mfcmapi, we manage to make the change. It means that it's feasible programmatically.

Question: how does mfcmapi proceed? Is it using outlook apis, or is it using server calls that we should be able to call succesfully as well?

The information we have found about this flag is here : https://msdn.microsoft.com/en-us/library/ee200692(v=exchg.80).aspx


-- Emmanuel Dreux <a href="http://www.cloudiway.com" title="IAM and migration solutions for the Cloud"> http://www.cloudiway.com</a>

How to export calendar items to csv-file with powershell

$
0
0

Hi guys, 

Does anyone know how to export calendar items, from a specific user to a CSV-file with a Power Shell script? 

Example: 

How do I export all calendar items from the mailbox jordi@domain.com to a CSV-file with a Power Shell script? 

Thanks for you support! 

Kind regards, 

Jordi Martin Lago 

Viewing all 7132 articles
Browse latest View live


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