Friday, August 2, 2013

SharePoint 2013 Sig in as different user ?

As you might be aware that in SharePoint 2010 & 2007, there was an option in the user menu where you could login as a different user, for testing or other purpose.
But as soon as we move to Microsoft SharePoint Server 2013, you will notice that the Sign in as Different User menu option is missing.

This was a great tool for developers and IT Pros\admins who wanted to test their solutions or customizations. In the new version of SharePoint I would say we are badly missing this option.

I'm not sure why they have removed it. There can be multiple reasons like

·         Caching Problems
·         Documents opened in external applications are saved with an unexpected user account
·         Page content shows information from the previous user due to cached information
·         Session variables contain information from previous users as the cookies are not cleared...

The below workaround allows users who have more than one AD account for testing to quickly login with a different account to SharePoint - but it does not guarantee that no artifacts from the previous user remain!

To work around this issue, use one of the following methods.

·         Start Windows Internet Explorer by using the Run as different user option, and then go to the SharePoint site
·         Access the SharePoint site by using the following URL: http://<site url>/_layouts/closeConnection.aspx?loginasanotheruser=true
·         You can add some code in the Masterpage for the same
·         Create a sandbox solution for the same

Wednesday, April 17, 2013

SharePoint Shortcut URL



· Add web parts to any page: append ?PageView=Shared&ToolPaneView=2
· Create New Site Content /_layouts/create.aspx
· Create New Site: _layouts/NewsbWeb.aspx
· List Template Gallery: _catalogs/lt/Forms/AllItems.aspx
· Master Page Gallery: _catalogs/masterpage/Forms/AllItems.aspx
· Manage your Alerts _layouts/SubEdit.aspx
· Create New Alert: _layouts/SubChoos.aspx
· Manage Site Collection Administrators /_layouts/mngsiteadmin.aspx
· Manage Sites and Workspaces /_layouts/mngsubwebs.aspx
· Manage People /_layouts/people.aspx
· Manage User Permissions /_layouts/user.aspx
· Modify Navigation /_layouts/AreaNavigationSettings.aspx
· Modify Site Navigation: _layouts/SiteNavigationSettings.aspx
· Recycle Bin /_layouts/AdminRecycleBin.aspx
· Site Directory _layouts/SiteDirectorySettings.aspx
· Save Site as Template: _layouts/savetmpl.aspx
· Site Settings page: _layouts/settings.aspx
· Create New Web Part Page: _layouts/spcf.aspx
· Site Template Gallery : _catalogs/wt/Forms/Common.aspx
· Site Column Gallery /_layouts/mngfield.aspx
· Site Content Types /_layouts/mngctype.aspx
· Site Content and Structure Manager /_layouts/sitemanager.aspx
· Site Usage Summary /_layouts/SpUsageWeb.aspx
· User Alerts /_layouts/sitesubs.aspx
· View All Site Content /_layouts/viewlsts.aspx
· Web Part Gallery: _catalogs/wp/Forms/AllItems.aspx
· Web part maintenance mode: append ?contents=1 to the URL of the page
· Open the page in Edit Mode: In Address bar, Type "javascript:MSOLayout_ToggleLayoutMode();"
or "javascript:MSOTlPn_ShowToolPane(’2′);" in the Address bar
· Add Web Parts Pane: ?ToolPaneView=2

Search Crawl Rule to exclude Item



Below is the list of crawl rules which can be excluded from the Search Results in SharePoint 2010:

http://*allitems.aspx
http://*default.aspx
http://*byeditor.aspx
http://*createdbyme.aspx
http://*recentchanges.aspx
http://*active.aspx
http://*duetoday.aspx
http://*mygrtsks.aspx
http://*myitems.aspx
http://*byowner.aspx
http://*editform.aspx
http://*dispform.aspx
http://*overview.aspx
http://*summary.aspx
http://*calendar.aspx
http://*byauthor.aspx
http://*my-sub.aspx
http://*myblog.aspx
http://*allcomments.aspx
http://*allposts.aspx
http://*myposts.aspx
http://*how%20to%20use%20this%20library.aspx
http://*vwadmin.aspx
http://*singlecirculars.aspx

Tuesday, April 9, 2013

Installing and configuring PDF iFilter



1. Install Adobe PDF iFilter 9 for 64-bit platforms (Server holding Crawl\Index role).
2. Verify that PDF has been added to the registry.
a. Run Regedit
b. Within left-side tree, browse to: \\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office Server\14.0\Search\Applications\{site GUID}\Gather\Portal_Content\Extensions\ExtensionList
c. If PDF extension is present, skip to Step 3. If PDF extension is not present, continue with Step d.
d. Right click on right-side Extension List pane and choose New > String Value
e. Add a name to the new Registry Key (e.g. “48”)
f. Double click the new Registry Key. For “Value data”, enter “pdf” 


Note: This can also be achieved via SharePoint Server Search Administration page by adding ‘pdf’ to list of File Types in Search Administration->File Types. This would automatically add an entry for ‘pdf’ filetype as mentioned above in step 1

3. Verify that PDF has the correct settings in a second registry location.
a. While still in Regedit, within the left-side tree, browse to: \\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office Server\14.0\Search\Setup\Filters\.pdf
b. Verify the following values. If values are not as shown, edit them.
i. <REG_SZ> Default = <value not set>
ii. <REG_SZ> Extension = pdf
iii. <REG_DWORD> FileTypeBucket = 1
iv. <REG_SZ> MimeTypes = application/pdf 



4. Verify that PDF has the correct settings in a third registry location.
a. While still in RegEdit, within the left-side tree, browse to: \\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office Server\14.0\Search\Setup\ContentIndexCommon\Filters\Extension\.pdf
b. Verify the following values.
If values are not as shown, edit them.
i.                    <REG_MULTI_SZ> Default = {E8978DA6-047F-4E3D-9C78-CDBE46041603} Warning: You need to verify that this GUIS is there. The original value won’t work!



5. Verify that pdf.gif is present at the following location:

C:\Program Files\Common Files\Microsoft Shared\web server extensions\14\TEMPLATE\IMAGES

6. Add an entry in docicon.xml for the pdf icon:

C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\XML
<Mapping Key="pdf" Value=".gif">
Note: Step 4 & 5 are done in order to have the pdf icon in SharePoint while it displays the search results.
7. Restart all SharePoint services as well as IIS.

Refer:
http://www.adobe.com/special/acrobat/configuring_pdf_ifilter_for_ms_sharepoint_2007.pdf
http://www.adobe.com/support/downloads/detail.jsp?ftpID=4025
http://support.microsoft.com/kb/2293357
http://www.adobe.com/support/downloads/thankyou.jsp?ftpID=4025&fileID=3941  

Monday, April 1, 2013

SharePoint and SQL Clustering

SharePoint 2010 H\W & S\W Requirements

Below are the minimum H\W & S\W Requirements for SharePoint 2010 environment along with per-requisites.


Software requirement
Component  
Minimum Version Required

Operating system
64-bit Windows Server 2008 with SP2
 64-bit Windows Server 2008 R2

SQL Server
64-bit SQL Server 2005 SP3 and CU3
64-bit SQL Server 2008 with SP1 and CU2 (or CU5+)
64-bit SQL Server 2008 R2
Active Directory Functional level
Should be Windows Server 2003


Hardware Requirement
Processor
64-bit, four cores for small deployments          
 (fewer than 1,000 users)
64-bit, eight cores for medium deployments
(between 1,000 to 10,000 users)
Ram
8 GB for small deployments     
(fewer than 1,000 users)
16 GB for medium deployments
(between 1,000 to 10,000 users)

HD for Web server and application Server
80 Gb should remain free for system drive. Rest drive and space depends on requirement.
HD Sql Server
Separate Data (mdf file) and log (ldf file) file drive each with minimum 50 gb free in real time.


Prerequisites
Web Server (IIS) role
Application Server role
Microsoft .NET Framework version 3.5 SP1
Microsoft Sync Framework Runtime v1.0 (x64)
Microsoft Filter Pack 2.0
Microsoft Chart Controls for the Microsoft .NET Framework 3.5
Windows PowerShell 2.0
SQL Server 2008 Native Client
Microsoft SQL Server 2008 Analysis Services ADOMD.NET
ADO.NET Data Services Update for .NET Framework 3.5 SP1
A hotfix for the .NET Framework 3.5 SP1 that provides a method to support token authentication without transport security or message encryption in WCF.
Windows Identity Foundation (WIF)

Sunday, March 24, 2013

Site Collection Restore Script

If we want to restore a single site collection through Powershell we use the following command:

Restore-SPSite "SiteURL" -path "Pathofbackupfile\backupfilename.bak" -Force -DatabaseServer DataBaseInstanceName -DatabaseName "ContentDataBase"

This will restore a single site collection. But if we have to restore many site collections then running the above command every time will not be feasible & is a waste of time.
Now the way out in this situation is to prepare a Powershell script & run the script once & it will restore all the site collections we want. This Powershell script reads the site URL, backup name, DataBase Server name & Content DataBase Name from a csv file. We will enter the url's & their respective backup file names, Server Name & ContentDataBase name in the csv file type & give the path of the csv file in the script. This script now reads the values one by one from each row & restores the site collections.
When the rows are finished from the csv file then it stops the script. In this way we can restore large number of site collections by running a single command.

The Powershell script is as follows:
$backupfolder= "Path of Backup files"
$filePath = "Path of .csv file"
$csv_info = Import-Csv $filePath
$count =$csv_info.count
#iterate Csv File
foreach ($line in $csv_info)
{
$siteurl = $line.SiteUrl.trim()
$DatabaseInstance = $line.DatabaseInstance.trim()
$ContentDatabase = $line.ContentDatabase.trim()
$backuppath = $backupfolder + "\" + $line.BackupPath.trim()
#cls
Restore-SPSite -Identity $siteurl -Path $backuppath -Force -DatabaseServer $DatabaseInstance -DatabaseName $ContentDatabase
#Write-Host $siteurl
Write-Host $backuppath
Write-Host "Sucess"
}
Save the file with the .ps1 extension. e.g.- "restorescript.ps1".
Create a csv file & insert the entries as follows
SiteUrl,BackupPath,DatabaseInstance,ContentDatabase
http://siteurl,siteurl.bak,InstanceName,WSS_Content_DBName
http://webapp/sites/siteurl2,siteurl2.bak,InstanceName,WSS_Content__DBName2
http://iconnectstaging/sites/siteurl3,siteurl3.bak,InstanceName,WSS_Content__DBName3
http://iconnectstaging/sites/siteurl4,siteurl4.bak,InstanceName,WSS_Content__DBName4

 When we have finished creating both the files, now open the Powershell Management tool & run a single command which contains only the path of the powershell script. e.g.- Restore-Path\restorescript.ps1.

The script will stop after all the site collection restoration is finished.

Restore Script with Site & Content Database Creation

$backupfolder= "Path of Backup files"
$filePath = "Path of .csv file"
$csv_info = Import-Csv $filePath
$count =$csv_info.count
#iterate Csv File
foreach ($line in $csv_info)
{
$siteurl = $line.SiteUrl.trim()
$DatabaseInstance = $line.DatabaseInstance.trim()
$ContentDatabase = $line.ContentDatabase.trim()
$backuppath = $backupfolder + "\" + $line.BackupPath.trim()
#cls
New-SPContentDatabase -Name $ContentDatabase -DatabaseServer $DatabaseInstance -WebApplication "http://demo" -MaxSiteCount 1 -WarningSiteCount 0
New-SPSite $siteurl -OwnerAlias "spad\farmadmin" –Language 1033 -Template "STS#0" -ContentDatabase $ContentDatabase
Restore-SPSite -Identity $siteurl -Path $backuppath -Force -DatabaseServer $DatabaseInstance -DatabaseName $ContentDatabase -confirm

#Write-Host $siteurl
Write-Host $backuppath
Write-Host "Sucess"
}


Site Collections Backup Script

If we want to take backup of a single site collection through Powershell we use the following command:

Backup-SPSite "http://sitecollectionurl" -Path "PhysicalPath\backupname.bak"

This will take the backup of a single site collection. But if we have to take the backup of many site collections then running the above command every time will not be feasible & is a waste of time.
Now the way out in this situation is to prepare a Powershell script & run the script once & it will take the backup of all the site collections we want. This Powershell script reads the site URL & the backup name from a csv file. We will enter the url's & their respective backup file names in the csv file type & give the path of the csv file in the script. This script now reads the values one by one from each row & takes the backup.
When the rows are finished from the csv file then it stops the script. In this way we can take the backup of large number of site collections by running a single command.

The Powershell script is as follows:

$backupfolder= "Folder Path where the backup is to be stored"
$filePath = "Path of the .csv file"
$csv_info = Import-Csv $filePath
$count =$csv_info.count
#iterate Csv File
foreach ($line in $csv_info)
{
$siteurl = $line.SiteUrl.trim()
$backuppath = $backupfolder + "\" + $line.BackupPath.trim()
#cls
Backup-SPSite -Identity $siteurl -Path $backuppath -Force
#Write-Host $siteurl
Write-Host $backuppath
Write-Host "Sucess"
}  
Save the file with the .ps1 extension. e.g.- "backupscript.ps1".

Create a csv file & insert the entries as follows:

SiteUrl,BackupPath
http://siteurl,siteurl.bak
http://webapp/sites/siteurl2,siteurl2.bak
http://webapp/sites/siteurl3,siteurl3.bak
http://webapp/sites/siteurl4,siteurl4.bak

When we have finished creating both the files, now open the Powershell Management tool & run a single command which contains only the path of the powershell script. e.g.- Backup-Path\backupscript.ps1.

The script will stop after all the site collection backup is finished.

Distributed cache in SharePoint Farm

During maintainence and operational work there is specific sequence that needs to be followed for Dsitributed cache to disconnect and conne...