Thursday, August 30, 2012

SharePoint Correlation ID

1. Run on the powershell
get-splogevent | ?{$_.Correlation -eq "<GUID>"} | select Area, Category, Level, EventID, Message | Format-List > C:\some.log
Where GUID is correlation id, and C:\some.log is written to this log file.

2. Run on SQL WSS_Logging
select [RowCreatedTime], [ProcessName], [Area],
   [Category],  EventID,  [Message] 
 from  [WSS_UsageApplication].[dbo].[ULSTraceLog] 
 where  CorrelationId='B4BBAC41-27C7-4B3A-AE33-4192B6C1E2C5'

Sunday, August 26, 2012

SharePoint 2010 Start Timer Job

Stop admin services, start immediately timer jobs, start admin services.
  • net stop SPAdminV4
  • Start-SPAdminJob
  • net start SPAdminV4

Good articles on SharePoint Variation

Run Sharepoint Configuration Wizard from powershell.
psconfig.exe -cmd upgrade -inplace b2b -force -wait -cmd installcheck –noinstallcheck

psconfig.exe -cmd upgrade -inplace b2b -force -wait -cmd installcheck –noinstallcheck

import-spweb -Identity http://xxx/xx -path C:\SPBU\Banners2\ExportList-8014c026-e4bd-4b6b-9a58-974c6a6fac83.DAT
import-spweb -Identity http://xxx/xx -path C:\SPBU\Promotions\ExportList-074335ed-2b00-4a1f-9db5-d3df31e2bcc9.DAT

Export content from SharePoint

function Export-All-SPWeb-Lists([string]$WebURL, [string]$ExportRootPath)
{
 [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint") > $null
 [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Deployment") > $null

 $versions = [Microsoft.SharePoint.Deployment.SPIncludeVersions]::All

 $exportObject = New-Object Microsoft.SharePoint.Deployment.SPExportObject
 $exportObject.Type = [Microsoft.SharePoint.Deployment.SPDeploymentObjectType]::List
 $exportObject.IncludeDescendants = [Microsoft.SharePoint.Deployment.SPIncludeDescendants]::All

 $settings = New-Object Microsoft.SharePoint.Deployment.SPExportSettings

 $settings.ExportMethod = [Microsoft.SharePoint.Deployment.SPExportMethodType]::ExportAll
 $settings.IncludeVersions = $versions
 $settings.IncludeSecurity = [Microsoft.SharePoint.Deployment.SPIncludeSecurity]::All
 $settings.OverwriteExistingDataFile = 1
 $settings.ExcludeDependencies = $true

 $site = new-object Microsoft.SharePoint.SPSite($WebURL)
 #Write-Host "WebURL", $WebURL

 $web = $site.OpenWeb()
 #$list = $web.GetList($ListURL)
 foreach($list in $web.lists)
 {
  $settings.SiteUrl = $web.Url
  $exportObject.Id = $list.ID
  $newFolderPath = $ExportRootPath + $list.Title
  
  New-Item $newFolderPath -type directory -force
  
  $settings.FileLocation = $newFolderPath
  $settings.BaseFileName = "ExportList-"+ $list.ID.ToString() +".DAT"
  $settings.FileCompression = 1

  Write-Host "List", $list.Title
  Write-Host "FileLocation", $settings.FileLocation

  $settings.ExportObjects.Add($exportObject)

  $export = New-Object Microsoft.SharePoint.Deployment.SPExport($settings)
  $export.Run()
 }
 $web.Dispose()
 $site.Dispose()
}
 

Export-All-SPWeb-Lists "http://mySharePointWebApp/sites/mySiteCollection/" "C:\Temp\BackupRestoreTemp\"



Sunday, August 19, 2012

Carrot2 + eClipse


!SESSION Sun Aug 19 09:02:32 PDT 2012 ------------------------------------------
!ENTRY org.eclipse.equinox.launcher 4 0 2012-08-19 09:02:32.341
!MESSAGE Exception launching the Eclipse Platform:
!STACK
java.lang.ClassNotFoundException: org.eclipse.core.runtime.adaptor.EclipseStarter
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:626)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1438)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1414)



Check jar files in your project which are mentioned in config.ini if not proper then install manually and then follow the following steps:
  1. Select your product configuration file, right-click on it and select Run As Run Configurations
  2. Select "Validate plug-ins prior to launching". This will check if you have all required plug-ins in your run configuration. If this check reports that some plug-ins are missing, try clicking the "Add Required-Plug-Ins" button. Also make sure to define all dependencies in your product. And your application start running
It turns out eClipse default only around 10 plugin selected, once click on "Select All". The Carrot2 WorkBench should be able to be built. 
 
A couple of links: 
1. Eclipse download: http://www.eclipse.org/downloads/
2. Target Platform download: http://www.eclipse.org/downloads/
place target platform into  C:\Projects\Carrot2\Source\workbench\org.carrot2.workbench.target
where subfolder has eclipse version (3.5 or 3.6.2)