Search This Blog

Showing posts with label Sharepoint Tricks and Tips. Show all posts
Showing posts with label Sharepoint Tricks and Tips. Show all posts

Tuesday, August 9, 2016

How to Add/Modify your Hosts file

1. Go to  Start -> All Programs -> Accessories -> Notepad

2. Type Notepadin the search field, Right-click Notepadand select Run as administrator.

3. From Notepad, open the following file: C:\Windows\System32\Drivers\etc\hosts

4. Make the required entries to the file.

5. Click File -> Save to save your changes.

Thursday, June 23, 2016

You need to be a site collection administrator to set this property.

Issue Description

Recently I was trying to add a site collection administrator to a site and I got the belowmessage

You need to be a site collection administrator to set this property.   at Microsoft.SharePoint.ApplicationPages.ManageSiteAdminPage.BtnSubmit_Click(Object sender, EventArgs e)
   at System.Web.UI.WebControls.Button.OnClick(EventArgs e)
   at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
   at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)




I was already the site collection administrator to the site and it did not make any sense.

Fix

On further trouble shooting, I found the solution for this.Browse to Central Administration - > Site Collection Quotas and Locks.

The options available here are:

       Not locked
Adding content prevented
Read-only (blocks additions, updates, and deletions)
No access

This site collection was in Read-only status. Unlock it (Change the status to  "Not Locked")



Friday, January 29, 2016

How to change the URL for SharePoint Central Administration site

If you extend the Central Administration web application (using GUI or psconfig command) to run on multiple servers, and when you click on SharePoint Central Administration icon you're still redirected to the first SharePoint server where Central Administration is hosted.

The URL has to be changed via registry on all SharePoint servers to fix this.

To change the URL for SharePoint Central Administration URL:

1) Open Registry editor

2) Backup the registry before making changes


3) Go to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\14.0\WSS and change the value of CentralAdministrationURL to the new URL


Tuesday, December 29, 2015

Configuration Failed - Failed to connect to the configuration database: Error during decryption. Ensure the passphrase is correct.

Issue Description

1. I was trying to connect a SharePoint server to an existing farm after entering the farm passphrase.
The configuration wizard fails and gives me the below error message
Configuration Failed
Failed to connect to the configuration database: 
An exception of type System.ArgumentException was thrown. Additional exception information: Error during decryption. Ensure the passphrase is correct.




2. I tried putting in a garbage passphrase and it gave an error message: The passphrase you entered is incorrect. Please try again

3. But when I tried putting in the correct farm passphrase, it went past this stage and the configuration wizard failed.

Fix

1. Clear SharePoint Configuration Cache on all SharePoint servers

2. Run the configuration wizard on the new server


SharePoint 2013: The server was unable to save the form at this time. Please try again.

Error Description

When I am trying to save data on any list in the farm I got the below error
The server was unable to save the form at this time. Please try again.



Fix


An IISRESET fixed the issue.

Thursday, July 16, 2015

Publish SharePoint Calendar to Microsoft Outlook

1. Browse to SharePoint site

2. Click on the SharePoint Calendar link on the left navigation

3. This brings up the calendar.



4. On the top of the page, select Calendar Tools -> Calendar. This will open the ribbon option for the calendar.



5. Click on Connect to Outlook.



6. This opens a pop up. Click Allow.



7. Click Allow


8. Click Yes


9. This will add the SharePoint Calendar in your Microsoft Outlook Calendar section

Tuesday, July 14, 2015

How to delete a corrupted SharePoint list using PowerShell

$web = get-spweb -Identity http://sp2010
$list = $web.lists["corrupted list name"]
$list.AllowDeletion = $true
$list.Update()
$list.Delete()

Monday, July 13, 2015

SharePoint Developer Dashboard

Developer Dashboard is a great feature on SharePoint 2010. This feature is disabled by default. And it provides performance and tracing information that can be used to debug and troubleshoot page rendering time issues. (slow page loads, web part issues, query delays) .Enabling this great feature will get critical information about execution time, log correlation ID, critical events, database queries, service calls, SPRequests allocation and webpart events offsets.

The Developer Dashboard feature is turned off by default, but it can be enabled very easy via stsadm or PowerShell.

Check status of Developer Dashboard
stsadm -o getproperty -pn developer-dashboard

Enable Developer Dashboard via stsadm:

�On� Mode:
stsadm -o setproperty -pn developer-dashboard -pv On

�OnDemand� Mode:
stsadm -o setproperty -pn developer-dashboard -pv OnDemand

Disable Developer Dashboard via stsadm:
stsadm -o setproperty -pn developer-dashboard -pv Off

Wednesday, July 8, 2015

SharePoint Recycle Bin � First Stage and Second Stage

SharePoint Recycle Bin stores and keeps a track of the items deleted from the site. When an item is deleted in SharePoint, it is not completely deleted, it is actually stored in a Recycle Bin . The main idea of a Recycle Bin is to restore contents that are accidentally deleted or retrieve data that should not have been deleted. There are 2 stages to the Recycle Bin.

First Stage Recycle Bin

Whenever an item is deleted from the site it goes to the Recycle Bin (users� Recycle Bin) of the site and stays there till it is restored or it expires. By default the items are stored in the Recycle bin for 30 days. This setting is configured at the web application level from Central Administration. You can access a site's Recycle Bin by clicking on the Recycle Bin link on the left navigation (Quick Launch).

Normal user's Recycle Bin URL - /_layouts/recyclebin.aspx




If an item is deleted from the User�s Recycle Bin (First Stage Recycle Bin), it goes to the Site Collection Recycle Bin (Second Stage Recycle Bin).

Second Stage Recycle Bin

When an item is deleted from a site's Recycle Bin it goes to Site Collection Recycle Bin and stays there till it is restored or it expires. By default the items are stored in the Recycle bin for 30 days. If the item is deleted from here, it is deleted forever. To access the Site Collection Recycle Bin, browse to Site Settings -> Site Collection Administration -> Recycle Bin.


This Recycle Bin has two views: End User Recycle Bin Items view displays all the contents of all the recycle bins of all the sites under that particular site collection whereas Deleted From End User Recycle Bin view displays all the items which have been deleted from the sites recycle bins

Site Collection's Recycle Bin has two views :

End user Recycle Bin items URL - /_layouts/AdminRecycleBin.aspx



Deleted from end user Recycle Bin URL - /_layouts/AdminRecycleBin.aspx?View=2



Note:
- If an end user deletes and item, it will go to his Recycle Bin. Other users will not be able to see another users� recycle bin.

- When you disable the Recycle Bin feature, all the items existing in it will be removed permanently.

Wednesday, July 1, 2015

SharePoint 2010 User Active Directory Permissions not updating

When you are using Active Directory groups and add those groups into SharePoint groups, you will run into issues while modifying the members of the Active Directory group. It takes 24 hours (by default) to reflect this change to SharePoint.This behavior is controlled by a property called Token-timeout.By default, this value is set to 1440 minutes (24 hours) .
SharePoint fetches user token information from the SharePoint database. If the user has never visited the site or if the user�s token was generated more than 24 hours previously, SharePoint generates a new user token by trying to refresh the list of groups that the user belongs to.(MSDN Reference)

To check which values you currently have, try running the below:
 stsadm �o getproperty �propertyname token-timeout

If you want to minimize this token time out value (time it takes to refresh the token), follow the below instructions.

To set a valid time to 2000 minutes, use the following syntax:
stsadm -o setproperty -pn token-timeout -pv 2000
Note: You can substitute -pn for -propertyname and -pv for -propertyvalue. 
Name
Value
propertyname
Gets or sets the name of the property.
propertyvalue
A valid time interval, in minutes. The default setting is 1440 minutes.

The syntax for the setproperty operation is:
stsadm -o setproperty -propertyname token-timeout �propertyvalue <A valid time interval, in minutes>

Note:
- This property applies to the entire farm.

- The use of stsadm will only affect the ContentServiceWeb service property and not the AdministrationServiceWeb service property.

Warning: If you set Token-timeout to zero (0) it can bring the farm down and you get this error message
"The context has expired and can no longer be used. Exception from HRESULT: 0x80090317"


Active Directory Group Sync Issue with SharePoint 2013 Permissions

Issue
AD security group permissions are being used to control access in SharePoint 2013, however, changes to group membership in AD are not taking effect immediately in SharePoint 2013. In simple words, even after you remove a user from the AD security group - user is still able to access the site. If you add a new user to the AD security group, user still receives access denied error message in SharePoint.

Workaround - If you need to have the change take effect immediately, you can do an Application Pool recycle for that web application. 

Cause
In Windows Claims enabled web application (the default for SharePoint2013), the logon token life time is by default 10 hours and cache life time is by default 10 minutes. Hence, the AD group modifications will not reflect immediately in SharePoint user sign-in. internally what happens is when a user accesses a SharePoint site, SharePoint checks the security token store cache for the user's claims. If the claim is found in the cache, SharePoint uses it to authorize the user. If not, SharePoint queries for claims again from the AD.

To check which values you currently have, try running the below:

$sts = Get-SPSecurityTokenServiceConfig
$sts.WindowsTokenLifetime
$sts.LogonTokenCacheExpirationWindow

Resolution
The value of token life time and cache expiration time can be set to the desired value per your needs.Lowering the token life time introduces more round trips to AD to authenticate the user, which means performance characteristics should be monitored to determine the appropriate lifetime.I have seen 10 minutes being recommended to use, but this is something that needs to be tested as it should be considered on a case by case scenario.If you would like to change the token life time, you can use the following PowerShell cmdlet to set the Windows token life time and cache expiration window to the desirable value.

The below example sets your WindowsTokenLifetimeto 10minutes (10 hours is the default) and the Cache Expiration to 2 minutes (10 minutes is the default).

$sts = Get-SPSecurityTokenServiceConfig
$sts.WindowsTokenLifetime = "00:10:00"
$sts.LogonTokenCacheExpirationWindow = (New-TimeSpan �minutes 2)
$sts.Update()
iisreset 

Warning
If you set Token lifetime lesser than the token expiration window, you get this error message
"The context has expired and can no longer be used. Exception from HRESULT: 0x80090317"

Friday, June 26, 2015

SharePoint Feature Installation, Activation, Deactivation, and Uninstallation using PowerShell

To install a SharePoint feature with PowerShell
Install-SPFeature FeatureFolderName

To activate a feature
Enable-SPFeature FeatureFolderName -Url http://server/site/subsite

To deactivate a feature
Disable-SPFeature FeatureFolderName -Url http://server/site/subsite

To uninstall a feature
Uninstall-SPFeature FeatureFolderName

Examples:

Activate site collection feature
$site = Get-SPSite http://sp2010
Enable-SPFeature -Identity �FeatureName� -Url $site.Url
$site.Dispose()

Activate site feature
$web = Get-SPWeb http://sp2010
Enable-SPFeature -Identity �FeatureName� -Url $web.Url
$web.Dispose()

Activate site collection features for all site collections in a Web Application
$webApp = Get-SPWebApplication -Identity http://sp2010
$webApp | Get-SPSite -limit all | ForEach-Object {Enable-SPFeature -Identity �FeatureName� -Url $_.Url}

How to Deactivate a SharePoint feature using PowerShell or STSADM

To Disable a SharePoint Feature, you must first determine the scope of the feature. If the scope is Web-based or is a site collection scope, the URL parameter is required. However, if the scope is farm-based, the URL parameter is not required.

Syntax - PowerShell

Disable-SPFeature [-Identity] <SPFeatureDefinitionPipeBind> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-Force <SwitchParameter>] [-Url <String>] [-WhatIf [<SwitchParameter>]]

This example disables the "MyCustom" Web site scoped feature at http://somesite.
Disable-SPFeature -identity "MyCustom" -URL http://somesite

This example disables all features in the subsite at http://somesite/myweb.
$w = Get-SPWeb http://somesite/myweb | ForEach{ $_.URL }
Get-SPFeature -Web $w |%{ Disable-SPFeature -Identity $_ -URL $w}

Syntax - STSADM

stsadm -o deactivatefeature
   -filename
   -name <feature folder>
   -id <feature ID>
   [-url] <URL name>
   [-force]

Parameter
Value
Description
filename
A valid file path, such as "MyFeature\Feature.xml"
Path to feature must be a relative path to the 14\Template\Features directory. Can be any standard character that the Windows system supports for a file name.
name
Name of the feature directory, such as �MyFeature�
Name of the feature folder located in the 14\Template\Features directory
id
A valid GUID, e.g.  �11d186e-7306-4902-a825-0eb7609e9280�
GUID that identifies the feature to activate
url
A valid URL, such as http://server_name
URL of the Web application, site collection, or Web site to which the feature is being activated


How to Activate a SharePoint feature using PowerShell or STSADM

To Enable a SharePoint Feature, you must first determine the scope of the feature. If the scope is Web-based or is a site collection scope, the URL parameter is required. However, if the scope is farm-based, the URL parameter is not required.

Syntax - PowerShell

Enable-SPFeature [-Identity] <SPFeatureDefinitionPipeBind> [-AssignmentCollection <SPAssignmentCollection>] [-CompatibilityLevel <Int32>] [-Confirm [<SwitchParameter>]] [-Force <SwitchParameter>] [-PassThru <SwitchParameter>] [-WhatIf [<SwitchParameter>]]

This example enables the "MyCustom" site scoped SharePoint Feature at http://somesite.
Enable-SPFeature -identity "MyCustom" -URL http:// sitename

This example enables all SharePoint Features in the subsite at http://somesite/myweb.
$w = Get-SPWeb http://somesite/myweb | ForEach{ $_.URL }
Get-SPFeature -Web $w |%{ Enable-SPFeature -Identity $_ -URL $w}

Syntax - STSADM

stsadm -o activatefeature
   {-filename <relative path to Feature.xml> | -name <feature folder> | -id <feature ID>}
   [-url] <URL name>
   [-force]

Parameter
Value
Description
filename
A valid file path, such as "MyFeature\Feature.xml"
Path to feature must be a relative path to the 14\Template\Features directory. Can be any standard character that the Windows system supports for a file name.
name
Name of the feature directory, such as �MyFeature�
Name of the feature folder located in the 14\Template\Features directory
id
A valid GUID, e.g.  �11d186e-7306-4902-a825-0eb7609e9280�
GUID that identifies the feature to activate
url
A valid URL, such as http://server_name
URL of the Web application, site collection, or Web site to which the feature is being activated

Note : If you try to use the Url parameter on a farm-scoped feature, you receive the following error message:
The feature �<feature name>� applies to the entire farm; the Url parameter cannot be used with farm-scoped features.

Thursday, June 18, 2015

SharePoint Major Version and Minor Version

A major version is usually one that represents a milestone, such as completion of an outline or a chapter. Major versions are numbered with whole numbers, such as 3.0, 4.0, and so on.

A minor version represents interim check-ins while a particular file is under development. Minor versions are numbered with decimals, such as 4.1, 4.2, 4.3, and so on.

In many organizations, versioning is set up so that only the owner of the file and people who can approve items can see minor versions. In others, it is set up so that anyone who can edit files in the library, or anyone who has Read permission to the library, can see all versions.

Note: Major and minor versions are available in libraries, but not in lists.
Limiting the number of versions is generally a good practice. It means you can conserve space on the server and reduce clutter for users. But, if your organization is required to save all versions for legal or other reasons, do not apply any limits.
  • When you check out a file in a versioning-enabled library, a new version is created every time you check it back in. And, if major and minor versions are part of the configuration of your library, you can designate, at check-in, which type of version you are checking in. In libraries where check-out is required, versions are only created upon check-in.


  • In libraries where check-out is not required, a new version is created the first time you save after opening the file. Each subsequent save overwrites the version that you created with the first save. If you close the application and then reopen the document, the first save will, once again, produce a version. This can cause the number of versions to proliferate very rapidly.

How to View a file or item from previous version

If you need to view an older version of an item or file, you can select the older version and �view� it so that it becomes the current version.

1. Navigate to the list or library where your item or file is located.
2. Hover over the item or file for which you want to manage versions until you see a drop-down arrow.
3. Click the drop-down arrow and select Version History.
4. Hover over the version that you want to view and select the document.
5. This will display the document with that particular version.

How to Delete a previous version

If you need to make sure that no one can read a version that has inaccurate or otherwise troublesome information, you can delete it.

1. Navigate to the list or library where your item or file is located.
2. Hover over the item or file for which you want to manage versions until you see a drop-down arrow.
3. Click the drop-down arrow and select Version History.
4. Hover over the version that you want to delete until you see a drop-down arrow.
5. Click the drop-down arrow and select Delete.
6. When you are prompted to confirm the deletion, click OK.


Note: When you delete a version, it is sent to the Recycle Bin, where you, or another person who has the necessary permissions, can recover it. If you do not see the Recycle Bin on your site, your server administrator might have disabled it.

How to Restore a file or item from previous version

If you need an older version of an item or file, you can select the older version and �restore� it so that it becomes the current version.

1. Navigate to the list or library where your item or file is located.
2. Hover over the item or file for which you want to manage versions until you see a drop-down arrow.
3. Click the drop-down arrow and select Version History.
4. Hover over the version that you want to restore until you see a drop-down arrow.
5. Click the drop-down arrow and select Restore.
6. When you are prompted to confirm the restoration as your current version, click OK.

SharePoint Versioning

Versioning is available for list items in all default list types�including calendars, issue tracking lists, and custom lists. It is also available for all file types that can be stored in libraries, including Web Part pages.
Versioning helps us with the following:

Track history of a version -When versioning is enabled, you can see when an item or file was changed and who changed it. You can also see when properties (information about the file) were changed. For example, if someone changes the due date of a list item, that information appears in the version history. You can also see the comments people make when they check files into libraries.

Restore a previous version - If you made a mistake in a current version, if the current version is corrupt, or if you simply like a previous version better, you can replace the current version with a previous one. The �restored� version becomes the new current version.

View a previous version - You can view a previous version without overwriting your current version. If you are viewing version history within a Microsoft Office document, such as a Word or Excel file, you can compare the two versions to determine what the differences are.

To do this�
I need this permission�
View version history
Full Control, Contribute, Read
Restore a previous version
Full Control, Contribute
Delete a version
Full Control, Contribute
Unpublish a version
Full Control, Contribute
Recover deleted a deleted version (30 days)
Full control and/or Contribute

Propellerads