Since I have installed the CU1 to the Exchange 2013 I get an Internal Server Error with SyncFolderItems function if I try to sync one public folder. I know, this was working with exact the same code before I have installed the CU1.
The problem is happen only if I have more than 6 items in the folder. I have tested with Contact and mailfolder. This problem is also on one of my customers Exchange, he has also the CU1.
See this code:
Import-Module -Name "C:\Program Files (x86)\Microsoft\Exchange\Web Services\2.0\Microsoft.Exchange.WebServices.dll" $ews = New-Object Microsoft.Exchange.WebServices.Data.ExchangeService -ArgumentList "Exchange2013" $cred = (Get-Credential).GetNetworkCredential() function EnumFolders($folderidcnt) { $fiResult = $ews.FindFolders($folderidcnt,$null,$fvFolderView) foreach($ffFolder in $fiResult.Folders) { if($ffFolder.DisplayName -eq "2") {"Found:"+$ffFolder.DisplayName"ID:"+$ffFolder.Id $changes = $ews.SyncFolderItems($ffFolder.Id,[Microsoft.Exchange.WebServices.Data.BasePropertySet]::FirstClassProperties,$null,512,[Microsoft.Exchange.WebServices.Data.SyncFolderItemsScope]::NormalItems,"")"Changes In Folder:" + $changes.Count foreach($change in $changes) {"-"+$change.Item.Subject } }"- Folder:"+ $ffFolder.DisplayName; EnumFolders($ffFolder.Id); } } $ews.Credentials = New-Object System.Net.NetworkCredential -ArgumentList $cred.UserName, $cred.Password, $cred.Domain $ews.Url= "https://srv2012/EWS/Exchange.asmx" $folderidcnt = new-object Microsoft.Exchange.WebServices.Data.FolderId([Microsoft.Exchange.WebServices.Data.WellKnownFolderName]::PublicFoldersRoot,$null) $fvFolderView = New-Object Microsoft.Exchange.WebServices.Data.FolderView(1000) $psPropertySet = new-object Microsoft.Exchange.WebServices.Data.PropertySet([Microsoft.Exchange.WebServices.Data.BasePropertySet]::FirstClassProperties) $fvFolderView.PropertySet = $psPropertySet; $fiResult = $null do { EnumFolders($folderidcnt); }while($fiResult.MoreAvailable -eq $true)
I have activated the tracelog in IIS. Here is some output from it.