Translate

Tuesday, December 10, 2013

The expected version of the product was not found on the system


Are you trying to install any cummuliative update on SharePoint and receiving error "The expected version of the product was not found on the system". This is because you are missing some patches which are required before you install the update. You can open Central Admin and navigate to "Check product and patch installation status" page and check for missing patches. Alternatively, if you don't want to do the check and just want to install it, open command prompt and run the below command. Cheers !

packagename.exe PACKAGE.BYPASS.DETECTION.CHECK=1

Wednesday, November 27, 2013

Start/Stop SharePoint Services using Powershell

Are you supporting SharePoint servers ? and you have multiple front end servers ? Do you need to stop the SharePoint services and restart them ? Below are the two powershell scripts which will do it for you. You don't have to go to services.msc identify the services and manually stop and restart them. Just use the scripts below. Cheers !

** If you dont want to stop/start the world wide services please remove W3SVC.

Stop Services

Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

function StopServices(){
$services = @("SPAdminV4","SPTimerV4", "SPTraceV4","SPUserCodeV4","SPWriterV4","SPSearch4","W3SVC","OSearch14");

#Stop Windows Services
foreach($service in $services){
Stop-Service $service
$stoppedService = Get-Service $service
if($stoppedService.Status -eq "Stopped"){
Write-Message $service
}
}
}

function StopWebAnalytics(){
Get-SPServiceInstance |? {
if($_.TypeName -like "Web Analytics Data Processing Service"){
$_.UnProvision()
Write-Message "Web Analytics Data Processing Service"
}
}

Get-SPServiceInstance |? {
if($_.TypeName -like "Web Analytics Web Service"){
$_.UnProvision()
Write-Message "Web Analytics Web Service"
}
}
}

function StopIIS(){
Write-host "Stopping IIS";
iisreset /stop
}

function Write-Message([string]$serviceName){
Write-Host $number + "Successfully stopped service $serviceName"
}

StopServices
StopWebAnalytics

StopIIS

Start Services

Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

function StartServices(){
$services = @("SPAdminV4","SPTimerV4", "SPTraceV4","SPUserCodeV4","SPWriterV4","W3SVC","OSearch14");

#Start Windows Services
foreach($service in $services){

Start-Service $service
$StartedService = Get-Service $service
if($StartedService.Status -eq "Running"){
Write-Message $service
}
}
}

function StartWebAnalytics(){
Get-SPServiceInstance |? {
if($_.TypeName -like "Web Analytics Data Processing Service"){
$_.UnProvision()
Write-Message "Web Analytics Data Processing Service"
}
}

Get-SPServiceInstance |? {
if($_.TypeName -like "Web Analytics Web Service"){
$_.UnProvision()
Write-Message "Web Analytics Web Service"
}
}
}

function Write-Message([string]$serviceName){
Write-Host $number + "Successfully Started service $serviceName"
}

StartServices

StartWebAnalytics

Tuesday, September 17, 2013

Event ID 6398 : The Execute method of job definition Microsoft.SharePoint.Administration.SPSqmTimerJobDefinition (ID 58c09065-46c2-43a1-b6cc-fa5128d9723f) threw an exception. More information is included below.

Problem
6398:
The Execute method of job definition Microsoft.SharePoint.Administration.SPSqmTimerJobDefinition (ID 58c09065-46c2-43a1-b6cc-fa5128d9723f) threw an exception. More information is included below.
Data is Null. This method or property cannot be called on Null values.

Solution
The issue is your SharePoint timer job, Customer Experince Improvement Program [CEIP] is trying to gather report and it is failing.
You can open Central Admin with admin access,
- Navigate to Monitoring
- Click on Review Job Definitions
- Click on CEIP Data Collection
- Check the time when it is executing and match with the event log error timing. If it is same then this is the timer job creating issue for you.
- Click on the job and disable the job.


Monday, September 16, 2013

Event ID : 3759 Database 'something' on SQL Server instance 'someDB' is not empty and does not match current database schema.


One fine morning if you observe "Event ID : 3759  Database 'something' on SQL Server instance 'someDB' is not empty and does not match current database schema." in your front end servers, then there must something wrong on the build/patch which auto updates on your SharePoint. You can follow the steps  below to identify the build number and on which front end server it is missing.

1. Open Central Admin with Admin rights.
2. Click on Update and Migration from the left navigation.
3. Under Upgrade and Patch Management click on Check Product and Patch Installation Status.
4. Hit control + F and type the word Missing.
5. It should show you the front end server name and the build patch which is missing.

For me it was the Security Update for Microsoft SharePoint Foundation 2010 (KB2810059) 64-Bit Edition

Now patch installation involves two processes, one download the security patch and install it. Two run the PSConfig.exe to complete the same. It is important that you run PSConfig.exe or run the SharePoint configuration wizard to complete the patch installation.

Cheers !

Nintex Workflow: Create List Item using Web Service. Useful for accessing and creating list at different levels of site.

Solution: I got one requirement to create list item at different site level using OOB feature of SharePoint. We couldn’t use SharePoint Designer because that is blocked, SharePoint OOB feature won’t allow you to create this. We have Nintex workflow which allows you to do this using the web service activity.

Step 1: At your source list create a workflow with one Build String activity and add the below code and store it in a variable.

<Batch OnError="Continue" ListVersion="1" >
   <Method ID="1" Cmd="New">
      <Field Name='ID'>1</Field>
      <Field Name="FirstName">TestABC</Field>
   </Method>
</Batch>
 












Step 2: Add the call web service activity. In the URL section add the /_vti_bin/lists.asmx web service of the destination site. Select UpdateListItems from the web method. Put the destination list name. Add the variable used on the previous activity at the updates(xml) section.

 Your source list workflow should look like below.



 Now you are good to go, just make sure on the url you have a list DestinationTest and that contains a column FirstName.


Cheers !

Workflow changes in SharePoint Designer not taking effect

I was using a SharePoint Designer workflow and one day I had to make some changes to the workflow. The changes were not taking any impact. After so many attempts I executed the below steps which fixed the issue.

Soltuion 1:
A quick solution is to disassociate the workflow, make changes to the workflow again and associate it back with the list.
Steps:
Go to List Settings > Workflow settings > Remove a workflow > Select Remove option from the radio button and click OK. Then open the workflow again from SharePoint designer, make some changes and click Finish, so it is associated again.
Your changes should now appear.
Solution 2:
Steps:
If workflow A is not working, create another workflow B. Create a valid any IF condition in workflow B and close the workflow. It will generate the XOML rules file. Open the XOML rules file and XOML workflow file of workflow A in notepad and copy paste the contents in the XOML files of workflow B (your new workflow). Now open your workflow B, you can see everything got copied from A. Disassociate workflow A from your list and associate workflow B.
Solution 3:
Steps:
Delete the files in from \local settings\app data\msft\websitecache and \app data\msft\sharepoint esigner\proxyassemblycache folders. This cleared things out.

Cheers !

Event 6482 : Reason:Invalid Query. Application Server Administration job failed for service instance

Event ID 6482 is a common issue of either WMI Control stopped or the SharePoint cache [C:\ProgramData\Microsoft\SharePoint\Config] is full. If WMI cotrol is not stopped, we can follow the steps below to avoid logging this error -
- Stop the SharePoint timer service.
- Navigate to C:\ProgramData\Microsoft\SharePoint\Config and identify the folder contains cache.ini file.
- Take backup of the folder and delete all files, except the cache.ini
- Open cache.ini and remove the content and put 1. Save the file.
- Restart the timer service.
- As soon as the timer service starts it would create the xml files.
The error in event log should be gone now.
Cheers !