Tuesday 23 December 2014

SharePoint 2010

Plan managed metadata (SharePoint Server 2010)

http://technet.microsoft.com/en-us/library/ee530389.aspx



Managed metadata overview (SharePoint Server 2010)

http://technet.microsoft.com/en-us/library/ee424402.aspx



SharePoint 2010 – Provisioning User Profile Synchronization

http://blogs.msdn.com/b/russmax/archive/2010/03/20/sharepoint-2010-provisioning-user-profile-synchronization.aspx



Configure profile synchronization (SharePoint Server 2010)

http://technet.microsoft.com/en-us/library/ee721049.aspx



User Profile service overview (SharePoint Server 2010)

http://technet.microsoft.com/en-us/library/ee662538.aspx



User Profile Replication Engine overview (SharePoint Server 2010)

http://technet.microsoft.com/en-us/library/cc663011.aspx



Create, edit, or delete a User Profile service application (SharePoint Server 2010)

http://technet.microsoft.com/en-us/library/ee721052.aspx



Maintain profile synchronization (SharePoint Server 2010)

http://technet.microsoft.com/en-us/library/ff681014.aspx



User Profile Synchronization Service unexpected failure - Events 6300-6309 (SharePoint Server 2010)

http://technet.microsoft.com/en-us/library/ff519523.aspx



User Profile Synchronization service not started (SharePoint Server 2010)

http://technet.microsoft.com/en-us/library/ff519522.aspx









Windows PowerShell for SharePoint Server 2010

http://technet.microsoft.com/en-us/library/ee662539.aspx



SharePoint 2010 Products administration by using Windows PowerShell

http://technet.microsoft.com/en-us/library/ee806878.aspx



SharePoint Foundation 2010

http://technet.microsoft.com/hi-in/library/cc288070(en-us).aspx  



Initial configuration (SharePoint Foundation 2010)

http://technet.microsoft.com/en-us/library/ee837435.aspx  



Prepare to host sites (SharePoint Foundation 2010)

http://technet.microsoft.com/en-us/library/cc303306.aspx  



SharePoint Server 2010

http://technet.microsoft.com/hi-in/library/cc303422(en-us).aspx



Upgrading to SharePoint Server 2010

http://technet.microsoft.com/en-us/library/cc303420.aspx  



Perform an in-place upgrade (SharePoint Server 2010)

http://technet.microsoft.com/en-us/library/cc303423.aspx  



Upgrade in place to SharePoint Server 2010

http://technet.microsoft.com/en-us/library/cc263212.aspx  



Troubleshoot upgrade issues (SharePoint Server 2010)

http://technet.microsoft.com/en-us/library/cc262967.aspx  



Resume upgrade (SharePoint Server 2010)

http://technet.microsoft.com/en-us/library/ff382638.aspx  



Configure automatic password change (SharePoint Foundation 2010)

http://technet.microsoft.com/en-us/library/ff607826.aspx  



Configuring Kerberos authentication for SharePoint 2010 Products (white paper)

http://technet.microsoft.com/hi-in/library/ff829837(en-us).aspx  



Video demos and training for SharePoint Server 2010

http://technet.microsoft.com/hi-in/library/cc262880(en-us).aspx

SharePoint Administration Interview

What timer job is responsible for propogating changes to SharePoint configuration objects across the farm?

HiddenListFullSyncTimerJob

Which of the following logs is not intended to be read directly in SharePoint 2010?

Which of the following is not a scope for SharePoint features?

How should the User Profile Synchronization Service be configured via PowerShell?

By default, what TCP ports are used for PowerShell v2 remoting (non-SSL/SSL)?

The AssignmentCollection parameter is available on all SharePoint cmdlets. Which of the following cmdlets actually utilize assignment collections?


True or False: If a cmdlet parameter specifies that it takes a *PipeBind object, it will always be set by output from previous cmdlets in the pipeline.

What downloadable package contains PowerShell and other Windows Management components?

Which one of the following shows a call of a static method?

True or False: SharePoint Service Application Proxies only connect to SharePoint Service Applications (in SharePoint 2010 or 2013).

Which method must you call to persist changes to a SPPersistedObject to the configuration database?

Which of these machine-local groups are added by SharePoint?

True or False: Switch parameters and Boolean parameters are specified the same way in PowerShell cmdlets.

What method must be called to push web.config modifications added to a SPWebConfigModificationCollection to web applications?

What SPN prefix is used to identify service accounts for PowerShell CredSSP authentication?

Which of the following objects are not derived from SPPersistedObject?

Objects from which of the following object frameworks are not treated as first-class objects in PowerShell? First class objects can have their members (properties and methods) invoked directly via dot notation.

What is the root object of the SharePoint object model?

Which of the following are children of SPFarm?

Which version of PowerShell is the minimum required for SharePoint 2013?

Additional details about webs, lists, and list items are stored in a hashtable member of these objects named:

Move/Migrate SharePoint list items/documents and preserve metadata properties


In moving the mass documents to other folder or libraries there is a pretty common way by using Windows Explorer view. But there's a drawback to that method as the metadata properties like document properties get updated in the process - manily the modified Date/Time as well as the user would take on the role of the person that 'Last modfied '. This also applies to copying list data in the data sheet view from one list/library to another.

I have figured out a new way to doing this where you can save the current list properties after moving the documents as a template with content included and redeploying that to other location. 

So if you want to move the contents of a SharePoint Document Library or List and be able to preserve the item’s metadata/property values at the same time you should use this method:

The process to move the content of a SharePoint Document library or List and be able to preserve the item's metadata/property values at the same time you should use this method:

1. Create a Blank Document library where you want to move, don't worry about the custom field it will automatically created once document moved.

2. Go to to "Content and Structure" page. You can access this item within the site with Site Actions  >Site Settings then under Site Administration tab there is a option called Content and Structure.


3. Navigate to you Source Library and select the view that you would like to have moved. Then click on  View > Select the view . Then Click on Action > Move...

   Note: You can create you own custom view. Example You want to move 30 days old file. So  create your view which show files for only 30 Days.


 4. You'll then be prompted witha pop-up that will let you navigate to your destination library or Document library .After you find that, just press the OK button

Monday 22 December 2014

SharePoint 2013 Best Practices

http://social.technet.microsoft.com/wiki/contents/articles/12438.sharepoint-2013-best-practices.aspx

Migration from SharePoint 2010 to SharePoint 2013

1. Go to sql management studio and your databse right click db-->Tasks-->detach go to C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA(2files ".mdf and .ldf" files take)
2. go to 2013 server sql management studio -->attach both .mdf and ldf files
3. Create ur webapplication in 2013 site collection-->if any custom solutions,webparts etc add your site
4.using Powershell: Mount-SPContentDatabase -Name WSS_Contenet_2010 -WebApplication "http://webapp:2013"

How to get SharePoint Server Version

SharePoint Server Version
Open PowerShell:
PS C:\Users\My Name>(get-spfarm).buildversion
You will get Version

Or
PS C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\BIN>(get-spfarm).buildversion
Major Minor Build Revision
----- ----- ----- --------
14 0 6100 5002
Or
To see which build your products are, go to Central Administration > Upgrade and Migration > Check Product and patch installation status.
Or
http://SERVER/_admin/PatchStatus.aspx
Data Base Version:
Central Administration --> System Settings -->Manage servers in this farm
You can see:
Configuration database version: 14.0.6100.5002
Configuration database server: SREVER
Configuration database name: SharePoint_Config
Or
To see which build your databases are, go to Central Administration > Upgrade and Migration > Review database status.
Or
http://SERVER/_admin/DatabaseStatus.aspx

How to open Windows PowerShell

The use should have permission on SharePoint_Shell_Access, if not Adds a user to the SharePoint_Shell_Access role for the specified database.
How to add user to SharePoint_Shell_Access?
Go to Security–>logins–>[Domain\MyName]
Right click–>properties.
Click on User Mapping.
Select “SharePoint_Config” database in the —–Users Mapped to this login section:
Select “SharePoint_Shell_Access” in the —Database role membership for :SharePoint_Config

On the Start menu, click All Programs.
Click Microsoft SharePoint 2010 Products.
Click SharePoint 2010 Management Shell.
At the Windows PowerShell command prompt (that is, PS C:\>), type the following command, and then press ENTER:
Restore-SPFarm -Directory -RestoreMethod Overwrite -Item [-BackupId ] [-Verbose]
Note:
If you are not logged on as the Farm account, you are prompted for the Farm account’s credentials.

Microsoft.SharePoint.PowerShell

Get-Command –PSSnapin “Microsoft.SharePoint.PowerShell” | format-table name > C:\SP2010_PowerShell_Commands.txt
And
Get-Command –PSSnapin “Microsoft.SharePoint.PowerShell” | select name, definition | format-list > C:\SP2010_PowerShell_Commands_new.txt

How to Move content Databases using PowerShell

How to Move content Databases using PowerShell?
—————————–
Step1: Create an additional content database either using PowerShell (PS) or the UI namely:
Go to CA > Application Management > Manage Content Databases > Add a Content Database (I called my content database “WSS-Content-NewUserDB”).
Now we will Use PS
Syntax:
———-
PS C:\Users\Admin> Move-SPSite [-Identity] -DestinationDatabase [-
AssignmentCollection ] [-Verbose] [-Debug] [-ErrorAction ] [-WarningAction ] [-ErrorVariable ] [-WarningVariable ] [-OutVariable ] [-OutBuffer ] [-WhatIf] [-Confirm]
Eample:
——–
PS C:\Users\Admin> Move-SPSite -Identity http://sp2010 -Destinationdatabase WSS-Content-NewUserDB
Confirm
Are you sure you want to perform this action?
Performing operation “Move-SPSite” on Target “http://sp2010?
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is “Y”): y
WARNING: IIS must be restarted before this change will take effect.
Now you have to restart IIS.
open a command prompt window and type iisreset.

Web Config Modifications using PowerShell in SharePoint 2010

Web Config Modifications using PowerShell
Add-PSSnapin Microsoft.SharePoint.PowerShell
$oWebApp = Get-SPWebApplication http://SP2010
$oWebApp.WebConfigModifications
$oWebConfig = New-Object -TypeName Microsoft.SharePoint.Administration.SPWebConfigModification
$oWebConfig.name = "add[@key='TEST']"
$oWebConfig.path = "/configuration/appSettings"
$oWebConfig.value = "<add key='TEST' value='My Test' />"
$oWebConfig.owner = "oTest"
$oWebConfig.sequence = 0
$oWebConfig.type = [Microsoft.SharePoint.Administration.SPWebConfigModification+SPWebConfigModificationType]::EnsureChildNode
$oWebApp.WebConfigModifications.Add($oWebConfig)
$oWebApp.Update()
$oWebApp.Parent.ApplyWebConfigModifications()
GO to C:\inetpub\wwwroot\wss\VirtualDirectories\80
Open Web.config file, Search with "TEST", you will able to see <add key='TEST' value='My Test' />

Windows PowerShell for SharePoint Command Builder

SharePoint PowerShell Commands to get Feature List

Get All Feature List
Get-SPFeature >D:\a.txt
SharePoint Version
(get-spfarm).buildversion
To Check SharePoint is installed and working or not
get-spfarm
if you get below output then it's installed and working fine...
Name                                                                                                         Status
---- ------
SharePoint_Config_6983cd15-2834-4645-a3f3-b7c63500545f               Online

If status is Online, it's correct installation

Monday 15 December 2014

msoidcliL.dll file is missing


I was trying to authenticate sharepoint using SharePointOnlineCredentials. I am getting msoidcliL.dll file is missing error.

Same code is working from my development system.

Root Cause: The system where i was executing my code, it is not having msoidcliL.dll.

Solution:
The client system should have office 15 software or SharePoint Server 2013 Client Components SDK. So that it will give msoidcliL.dll

You can download from:
http://www.microsoft.com/en-us/download/details.aspx?id=35585

Saturday 6 December 2014

RAISERROR 50000 error

In SQL i was using below syntax, it was working fine. But after migrating to SQL 2012, i was getting error.
RAISERROR 50000 'Error.'

Error: RAISERROR 50000 error

Solution:
DECLARE @ErrorMsg varchar(500)

SET @ErrorMsg = 'Error'
RAISERROR (@ErrorMsg,16,1)

I have changed my code and updated my stored procedures. Problem solved.

this.context.session null

You are missing below line in web.config

<configuration>
  ...
  <system.webServer>
    ...
    <modules>
      <remove name="Session" />
      <add name="Session" type="System.Web.SessionState.SessionStateModule"/>
      ...
    </modules>
  </system.webServer>
</configuration>

Friday 5 December 2014

SQL Server 2012 connection string

 <add name="myProjectConn" connectionString="Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=ProjectDbName;Data Source=ProjectSQLSeverName"
providerName="System.Data.SqlClient" />

Could not load file or assembly 'AjaxControlToolkit, Version=3.0.30930.28736, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

I am working SP 2010 custom webpart, where I am using AjaxControlToolKit dll, I have added reference. When I build I am not getting any errors, after deploying while adding web part I am getting below error.

Could not load file or assembly 'AjaxControlToolkit, Version=3.0.30930.28736, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) 

Solution:

Download 'AjaxControlToolkit
You will get dll
Now add that dll to sharepoint server gac
To use gacutil on a development machine go to:
Start -> programs -> Microsoft Visual studio 2010 -> Visual Studio Tools -> Visual Studio Command Prompt (2010)

Then use these commands to uninstall and Reinstall respectively. Note I did NOT include .dll in the uninstall command.
gacutil /u myDLL

gacutil /i "C:\Program Files\Custom\AjaxControlToolkit.dll"

SharePoint WebPart SQL Connection string

<add name="AdventureWorksConnectionString"
connectionString="Data Source=SQLServerName;Initial Catalog=DbName;Persist Security Info=True;User ID=sa;Password=Microsoft"
        providerName="System.Data.SqlClient" />

<add name="AdventureWorksConnectionString" connectionString="Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=DBName;Data Source=SQLServerName"
        providerName="System.Data.SqlClient" />

The following module was built either with optimization enabled or without debug information

I was trying to attach the process to my web part code, i was getting above error.
Solution:

In the Visual Studio

Click on Tools
Options
Debugging
Options

Unchecked: "Enable Just My Code"


How to find sql connection string

Create a .txt file in SQL server.Ex: a.txt
Change .txt to .udl. Ex: a.udl
Double click on a.udl
It will open a window.
Enter SQL server name
Select authontication type.
Select Database
Click Test connection

Now right click on a.udl
Click on Open With
Select notepad
Now you will get sql connection string

A web part or web form control on this page cannot be displayed or imported. the type could not


Solution:
This is common error if you eg. changed WebPart name after creation and/or changed its namespace.

Since you are working on SharePoint 2010 and most likely with Visual Studio 2010 in VS project:

Option 1
Select your custom webpart
Use right click > Properties
In properties windows under SharePoint find Safe Control Entries
Click ... button
Verify your settings (namespace)

Retract your solution and delete your web part from Web Part Gallery (this can be your first step). Rebuild, package and deploy your project.

You don't need to edit your web.config manually!
Option 2
Since i imported old web part in VS 2010, and i tried to deploy in the same Site collection...I got this error..
I renamed my new project and instead of importing old file, i copied the code and deployed...

It work like a charm..

System.InvalidOperationException: Operation is not valid due to the current state of the object


Root Cause:
Typically this happens when AJAX controls are involved (Microsoft’s UpdatePanel or others that utilize AJAX POST requests.)

Solution:

Go to this path in SharePoint server.
C:\inetpub\wwwroot\wss\VirtualDirectories\80

Open web.config
Add below tags inside <appSettings>

<add key="aspnet:MaxHttpCollectionKeys" value="2000" /">
<add key="aspnet:MaxJsonDeserializerMembers" value="2000" /">

Another important change, which i did...

I was migrating MOSS 2007 to SP 2010.
I was using old custom webpart, which is having a class file.
It is referring
public class MyCustomClassWebPart : WebPart 

I changed above line to:
public class EditFormWebPart : Microsoft.SharePoint.WebPartPages.WebPart

Still if you get same error, then don't  press F5 or Ctrl+F5 from your Visual Studio.
Right click on project -->Select Retract, 
Then right  click on project-->Select Deploy.
If you press F5 or Ctrl +F5, you will get error...

It solved my problem.