Tag Archives: best and cheap sharepoint 2013 hosting

Sharepoint 2013 hosting – ASPHostPortal.com :: Solving Sharepoint cannot Login Problem by Using WAADby

Environment: SharePoint 2013, Windows Azure AD service as Identity Provider.

Issue: Cannot login to SharePoint Portal working and getting Session has timed out error. Steps to reproduce

  • Open SharePoint Portal
  • Portal navigates to Azure login page
  • After proving credentials, the page redirects to Azure login page

Cause: There is no SAMLResponse cookie available to validate the credentials and that is the reason why the login is failing. The FedAuth cookie that the SharePoint STS is setting before redirecting to SharePoint application is expiring. This is occurring because the cookie lifetime has exceeded the lifetime of the token issued by ACS, so it’s redirecting to get a new SAML token from ACS immediately.

ahp banner sharepoint-01

The login page keeps looping because because the default LogonTokenCacheExpirationWindow for the SharePoint STS is 10 minutes. The relying party by default it sets the token lifetime in ADFS to be 2 minutes, so as soon as it authenticated it knew the cookie was good for less time than the LogonTokenCacheExpirationWindow value. Therefore it goes back to ADFS to authenticate again. And so it goes , back and forth. So I needed to change the LogonTokenCacheExpirationWindow to be less than the SAML TokenLifetime.

Findings: The first time that you navigate to a SharePoint Portal that is secured with SAML claims, it redirects you to get authenticated and get your claims. Your SAML identity provider, also known as identity provider security token service (IP-STS), does all that and then redirects you to SharePoint. When you come back into SharePoint, SharePoint creates a FedAuth cookie; that is how SharePoint knows that you have been authenticated. To make a smoother end-user experience, SharePoint writes the FedAuth cookie value to the local cookies folder. On subsequent requests for that site, if SharePoint finds a valid FedAuth cookie for the site, SharePoint reads the cookie and takes you directly to the SharePoint content, without reauthenticating.
The token lifetime is determined by the Relying Party Trust in ADFS, and is stamped with the local time of that server before being sent to SharePoint. SharePoint is in charge of determining when it feels that the token has expired (based on the LogonTokenCacheExpirationWindow property). Both of these properties can be changed but unless you have a very specific scenario, there is likely no need. Default values work fine.

Resolution: The default lifetime for the SharePoint Relying Party in ACS and the STS token cache lifetime is 10 minutes. You can increase the SAML token lifetime in ACS on the SharePoint Relying Party trust to something higher that 600 seconds (10 minutes) so that the FedAuth cookie cache is lower than the SAML token lifetime.

Cheap and Recommended SharePoint 2013 Hosting

ASPHostPortal.com is Perfect, suitable hosting plan for a starter in SharePoint. ASPHostPortal the leading provider of Windows hosting and affordable SharePoint Hosting. ASPHostPortal proudly working to help grow the backbone of the Internet, the millions of individuals, families, micro-businesses, small business, and fledgling online businesses. ASPHostPortal has ability to support the latest Microsoft and ASP.NET technology, such as: WebMatrix, WebDeploy, Visual Studio 2015, .NET 5/ASP.NET 4.5.2, ASP.NET MVC 6.0/5.2, Silverlight 6 and Visual Studio Lightswitch, ASPHostPortal guarantees the highest quality product, top security, and unshakeable reliability, carefully chose high-quality servers, networking, and infrastructure equipment to ensure the utmost reliability

SharePoint 2013 Hosting – ASPHostPortal.com :: How to solve cannot connect to database at SQL server

You are engaged in building a new SharePoint Server 2013 farm on Windows Server 2012 servers. You have successfully installed all of the prerequisites and roles and features on all servers that will host SharePoint.

ahp banner sharepoint-01

You have installed and configured a new instance of SQL Server 2012. You have configured a database server alias on all SharePoint servers. You have not yet run the configuration wizard, but are now beginning configuration tasks. Your first task is to create the configuration database manually so as to avoid the lengthy GUID that SharePoint configuration wizard normally appends to the database name. On the batch serverYou run New-SPConfigurationDatabase, and then experience the following response in the management shell:

New-SPConfigurationDatabase : Cannot connect to database master at SQL server at [DatabaseAlias]. The database might not exist, or the current user does not have permission to connect to it. At line:1 char:1 + New-SPConfigurationDatabase -DatabaseName DB_Config -DatabaseServer [alias] – … + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidData:(Microsoft.Share… urationDatabase:SPCmdletNewSPConfigurationDatabase) [New-SPConfigurationDatabase], SPException + FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletNewSPConfigurationDatabase
This is a critical problem, as it prevents further installation efforts. Below are my troubleshooting steps and ultimate resolution.

Troubleshooting
Action: verified spelling of database server.
Results: verified.
Action: verify database alias (cliconfg).
Results: alias configured and appears to be correct.
Action: verify farm service account name and password by adding to managed accounts of another SharePoint farm.
Results: farm service account name successfully added to Managed Accounts of another farm.
Action: verify that farm service account added to SQL Server instance logins and configured with dbcreator and securityadmin roles. Start SQL Server Management Studio, navigate to [name]\security\.
Results: verified.
Action: verify that all SQL server services are running. Started SQL Server Configuration Manager
Results: verified that SQL Server, SQL Server Agent and SQL Server Browser are all running.
Action: verify that TCP/IP protocol is enabled. started SQL Server Configuration Manager
Results: verified that TCP/IP is enabled for SQL Native Client 11.0 Configuration (32 bit), SQL Server Network Configuration and SQL Native Client 11.0 Configuration.
Action: verify that remote connections are enabled. In SQL Server Management Studio, right-click server name instance in tree, select Properties, select Connections, look for Allow remote connections to this server.
Results: was enabled.
Action: check (trarget) SharePoint server Application log.
Results: found the following events correlated with attempts to run script:
Log Name: Application
Source: Microsoft-SharePoint Products-SharePoint
Foundation
Date: [date/time]
Event ID: 5586
Task Category: Database
Level: Error
Keywords:
User: [Administrator]
Computer: [ServerName]
Description:
Unknown SQL Exception -1 occurred. Additional error information
from SQL Server is included below.

A network-related or instance-specific error occurred while
establishing a connection to SQL Server. The server was not
found or was not accessible. Verify that the instance name
is correct and that SQL Server is configured to allow remote
connections. (provider: SQL Network Interfaces, error: 26 -
Error Locating Server/Instance Specified)
Event Xml:…

and

Log Name: Application
Source: Microsoft-SharePoint Products-SharePoint
Foundation
Date: [date/time]
Event ID: 3363
Task Category: Database
Level: Critical
Keywords:
User: [Administrator]
Computer: [ServerName]
Description:
Cannot connect to database master at SQL server at
[DatabaseServerAlias]. The database might not exist, or the
current user does not have permission to connect to it.
Event Xml:

Observation: issue likely due to connectivity with database; possible firewall issue – firewall blocking communication.
Action: disable firewall. On Server Manager, select Local Server, then click link next to Windows Firewall. Then click Turn Windows Firewall on of off.
Result: Settings are managed by GPO – can’t change.
Action: run netsh command: netsh firewall set allprofiles state off, then re-run New-SPConfigurationDatabase.
Result: same connection error.
Action: run netsh command: netsh firewall set opmode state off, then re-run New-SPConfigurationDatabase.
Result: same connection error.
Action: attempt ODBC connection using ODBC Data Source Administrator
Results: connection failed.
cannot connect to database at SQL server

Action: in Services control panel, set startup to Disabled. Restarted server.
Results: On reboot, Firewall disabled.
Action: attempt ODBC connection using ODBC Data Source Administrator.
Results: connection succeeded.
Observation: this is a firewall issue on the SQL Server instance.
Action: started Firewall service, then ran netsh scripts again, this time setting states to On. Then tested ODBC connectivity again.
Results: connection failed.
Action: on SQL Server, using the Windows Firewall with Advanced Security configured two TCP and two program inbound firewall rules: SQL – sqlbrowser.exe, SQL – sqlservr.exe, SQL – TCP 1433 and SQL – UDP 1434. Then tested ODBC connectivity again.
Results: connection failed.
Action: reviewed Firewall log.
Results: all TCP packets sent to SQL Server ports were being dropped.
Action: discussed results with sysadmin, who noted impact of group policy object. recommend that rules be created in local GPO instead. This can be verified by viewing rules under Windows Firewall with… / Monitoring / Firewall.
Results: none of the new firewall rules were listed.
Observation: New firewall rules were being overridden by GPO.
Action: launched local GP editor applet. Configured the four rules noted previously. Then tested ODBC connectivity again.
Results: connection succeeded.

Solution
Implement firewall rules as noted in reference [3]. These may need to be configured in GPO if Firewall access controlled by GPO.

Cheap and Recommended SharePoint 2013 Hosting

ASPHostPortal.com is Perfect, suitable hosting plan for a starter in SharePoint. ASPHostPortal the leading provider of Windows hosting and affordable SharePoint Hosting. ASPHostPortal proudly working to help grow the backbone of the Internet, the millions of individuals, families, micro-businesses, small business, and fledgling online businesses. ASPHostPortal has ability to support the latest Microsoft and ASP.NET technology, such as: WebMatrix, WebDeploy, Visual Studio 2015, .NET 5/ASP.NET 4.5.2, ASP.NET MVC 6.0/5.2, Silverlight 6 and Visual Studio Lightswitch, ASPHostPortal guarantees the highest quality product, top security, and unshakeable reliability, carefully chose high-quality servers, networking, and infrastructure equipment to ensure the utmost reliability

SharePoint 2013 Hosting – ASPHostPortal.com :: How to Fix SharePoint 0x8004010F Error

Task ‘SharePoint‘ reported error (0x8004010F) : ‘The SharePoint List  cannot be found. If the problem continues, contact the SharePoint site administrator. HTTP 404.

Issue: connected SharePoint Lists with the Outlook and we open the Outlook we see the error sometimes” Task ‘SharePoint’ reported error (0×80040102) : ‘Outlook cannot connect to the SharePoint List (site name – list name). The server may not be reachable from your location. Contact the SharePoint site administrator for more information. HTTP 0.

Cause: The issue could be of many reasons. find the below

1.   Could be the Lists is not connected properly with outlook
2.   Could be the list is removed
3.   make sure that all user accounts requesting have proper permissions

Solution: Ensure to check the following steps to resolve the issue.
If you no longer have to synchronize with the specific SharePoint list mentioned in the error, follow these steps to remove the SharePoint list from Outlook:

1.   Select Tools, and then click Account Settings.
2.   Click Account Settings, and then click SharePoint Lists.
sharepoint eror
3.   In the Account Settings dialog box, double-click the SharePoint list for which you received the error.
4.   Clear the check on Display this list on other computers with the account: and then click OK.
5.   Make sure that the SharePoint list for which you received the error is still selected, and then click Remove.
6.   Close the Account Settings dialog box

Cheap and Recommended SharePoint 2013 Hosting

ASPHostPortal.com is Perfect, suitable hosting plan for a starter in SharePoint. ASPHostPortal the leading provider of Windows hosting and affordable SharePoint Hosting. ASPHostPortal proudly working to help grow the backbone of the Internet, the millions of individuals, families, micro-businesses, small business, and fledgling online businesses. ASPHostPortal has ability to support the latest Microsoft and ASP.NET technology, such as: WebMatrix, WebDeploy, Visual Studio 2015, .NET 5/ASP.NET 4.5.2, ASP.NET MVC 6.0/5.2, Silverlight 6 and Visual Studio Lightswitch, ASPHostPortal guarantees the highest quality product, top security, and unshakeable reliability, carefully chose high-quality servers, networking, and infrastructure equipment to ensure the utmost reliability

SharePoint 2013 Hosting – ASPHostPortal.com :: How to Solve Cannot generate SSPI context in SharePoint

Today’s problem occured after I restarted a Hyper-V based SharePoint 2013 farm (Windows Server 2012, one SharePoint 2013 machine, one SQL Server 2012 machine, one DC). I fired up Central Administration and was hit with the following error:

ahp banner sharepoint-01

Unknown SQL Exception 0 occurred. Additional error information from SQL Server is included below.

The target principal name is incorrect. Cannot generate SSPI context.

After checking the obvious things – testing connectivity to the DB server, checking the SQL service was running, verifying permissions, etc – I initially figured this was an issue with my Hyper-V snapshots being out of sync, so I ran the SharePoint Products Configuration Wizard. This hit me with the following error:

Failed to detect if this server is joined to a server farm. Possible reasons for this failure could be that you no longer have appropriate permissions to the server farm, the database server hosting the server farm is unresponsive, the configuration database is inaccessible or this server has been removed from the server farm.

I attempted to rejoin the server farm to no avail, then I realised I was barking up the wrong tree. The initial error message suggests a Kerberos issue, while my farm is set up to use NTLM. After a lot of searching, this ancient forum thread pointed me in the right direction. In Active Directory, I opened the computer record for the DB server. In the attribute list, the servicePrincipalName attribute showed the following entries:

How to Solve Cannot generate SSPI context in SharePoint

Delete the two MSSQLSvc entries and then restart the database server. In most cases this should solve the problem. Without the SPNs, authentication falls back to NTLM as it should and the farm comes back to life.

Other users have reported that they also need to delete the RestrictedKrbHost entries. In a previous version of this post, I suggested deleting every entry – after all, if we’re using NTLM, we shouldn’t need any SPNs. However, if you delete all the entries you may find you have to remove and then re-add the database server to the domain.

I’m fairly certain that this issue arose when I added Analysis Services to the SQL Server instance on the database server. Other users have reported similar issues when adding Reporting Services and Integration Services to a SQL Server instance.

Cheap and Recommended SharePoint 2013 Hosting

ASPHostPortal.com
ASPHostPortal.com is Perfect, suitable hosting plan for a starter in SharePoint. ASPHostPortal the leading provider of Windows hosting and affordable SharePoint Hosting. ASPHostPortal proudly working to help grow the backbone of the Internet, the millions of individuals, families, micro-businesses, small business, and fledgling online businesses. ASPHostPortal has ability to support the latest Microsoft and ASP.NET technology, such as: WebMatrix, WebDeploy, Visual Studio 2015, .NET 5/ASP.NET 4.5.2, ASP.NET MVC 6.0/5.2, Silverlight 6 and Visual Studio Lightswitch, ASPHostPortal guarantees the highest quality product, top security, and unshakeable reliability, carefully chose high-quality servers, networking, and infrastructure equipment to ensure the utmost reliability

FREE ASP.NET Hosting for SharePoint :: How to Solve Stuck Deploying status in SharePoint 2010

Signs :

ahp banner sharepoint-01Typically we will properly deploy/update a remedy deal (that is usually, a remedy having a gaggle of graphic world-wide-web parts) inside our SharePoint 2010 farm. We all deployed/updated the solution from the order “Update-SPSolution –Identity <SolutionName>. wsp –LiteralPath <Solution Location>\<SolutionName>. wsp –GACDeployment –force” inside the SharePoint 2010 Administration Shell. When we attempted for you to up-to-date the solution, many of us approved that it option wasn’t up-to-date. We all noticed that the deployment reputation inside the SharePoint 2010 Middle Government the Rank was generally “deploying”.

Trouble:

The problem can be related with one of the items bellow

  • Microsoft company SharePoint Groundwork Workflow Timer Assistance is just not managing
  • SharePoint Timer service is just not managing

Alternative:

To check on the execution on the service on the point 1:

  • Open the SharePoint Middle Government Portal
  • Go to Take care of services on server, underneath Program Settings
  • Authenticate in the event the service “Microsoft SharePoint Groundwork Workflow Timer Service” is usually managing. Or even, start it

How to Solve Stuck Deploying status in SharePoint 2010

To check on the execution on the service on the point 2:

  • Open the Glass windows Products and services window to confirm the services which might be managing inside the server
  • Find the “SharePoint 2010 Timer” service as well as examine if it is managing
    How to Solve Stuck Deploying status in SharePoint 20102
  • In the event the service is just not managing, wide open the order range immediate
    – Form the order “net start sptimerv4” to start out the service as well as click Type in
    – If you receive “The service failed to start because of a logon inability. ”, edit the “Log On” account to make sure that the service identity account is usually put together effectively you need to the service

Immediately after making sure every one of the services are generally managing, release again the service.

Best Recommended SharePoint 2013 Hosting

ASPHostPortal.com is Perfect, suitable hosting plan for a starter in SharePoint. ASPHostPortal the leading provider of Windows hosting and affordable SharePoint Hosting. ASPHostPortal proudly working to help grow the backbone of the Internet, the millions of individuals, families, micro-businesses, small business, and fledgling online businesses. ASPHostPortal has ability to support the latest Microsoft and ASP.NET technology, such as: WebMatrix, WebDeploy, Visual Studio 2015, .NET 5/ASP.NET 4.5.2, ASP.NET MVC 6.0/5.2, Silverlight 6 and Visual Studio Lightswitch, ASPHostPortal guarantees the highest quality product, top security, and unshakeable reliability, carefully chose high-quality servers, networking, and infrastructure equipment to ensure the utmost reliability

SharePoint 2013 Hosting – ASPHostPortal.com :: How to Configures Refining SharePoint Search and Searchable Columns

Adding search refiners and creating searchable columns with SharePoint On the web can be a small bit diverse then with SharePoint 2013 on premise. In this blog post I’ll clarify how to add search refiners and the best way to make custom columns searchable. You will find 5 significant components we ought to implement

ahp banner sharepoint-01

  • Create a custom column
  • Add some content
  • Map a crawled property to a refinable managed property
  • Created the alias
  • Configure the refiners

Solution

  1. Create your custom column, for example Product.
  2. Create some content with the custom column.
  3. Wait for the column to be added as a crawled property, this might take up to 24 hours.
  4. Open the SharePoint admin center and click on Search.
    1hdvl
  5. Click on Manage Search Schema.
  6. Depending on the type of column you will need to use different type of preset Managed Properties.
    Managed property name Data type for mapping
    RefinableDate00 – RefinableDate19 Dates.
    RefinableDecimal00 – RefinableDecimal09 Numbers with max three decimals.
    RefinableDouble00 – RefinableDouble09 Numbers with more than three decimals.
    RefinableInt00 – RefinableInt49 Whole numbers.
    RefinableString00 – RefinableString99 Strings, Person or Group, Managed Metadata, Choice and Yes/No
  7. Search the related type on Managed Property.
    2ksdhvp
  8. Click on Edit Map Property in het drop-down menu.
  9. Add the Crawled property of the custom column, in our example it will be ows_Product.
    3jkbnl;fc
  10. Fill in the alias, this will make the column searchable.
  11. Save the changes.
  12. Close the SharePoint admin center and open the search center result page.
  13. Set the page in edit modus and edit the Refinement web part.
    4dkjvb
  14. Click on Choose refiners, and add the managed property, in this example RefinableString01
  15. Change the display name to the custom columns name, otherwise the refiner will be shown as RefinableString01
  16. Search for some content and enjoy the result!

Result

5jkbsdvloBest Recommended SharePoint 2013 Hosting

ASPHostPortal.com
ASPHostPortal.com is Perfect, suitable hosting plan for a starter in SharePoint. ASPHostPortal  the leading provider of Windows hosting and affordable SharePoint Hosting. ASPHostPortal proudly working to help grow the backbone of the Internet, the millions of individuals, families, micro-businesses, small business, and fledgling online businesses. ASPHostPortal has ability to support the latest Microsoft and ASP.NET technology, such as: WebMatrix, WebDeploy, Visual Studio 2015, .NET 5/ASP.NET 4.5.2, ASP.NET MVC 6.0/5.2, Silverlight 6 and Visual Studio Lightswitch, ASPHostPortal guarantees the highest quality product, top security, and unshakeable reliability, carefully chose high-quality servers, networking, and infrastructure equipment to ensure the utmost reliability

SharePoint 2013 Hosting – ASPHostPortal.com :: Deploying Managed Metadata Fields Declaratively

In this article, we will see how we are able to deploy Managed metadata fields in a declarative way in SharePoint

A managed metadata column lets you handle the data that people can enter into a column. Users select the terms or phrases that they enter within the column from a pre-defined set of managed terms.

ahp banner sharepoint-01The challenge comes if you desire to provision your custom managed metadata navigation field inside a declarative way, and adding this column to a content variety or a list instance without having losing all the strong functions that comes along making use of this field sort.

Out on the Box, if you added a managed column for your list SharePoint performs some actions behind the scene:

Creates a hidden note field attached to your column
Attached your list to two event receivers to update the taxonomy hidden list .
Fills in some properties related to the current web and taxonomy list id
Creates a taxonomy search managed  property after a full crawl that could be used as a refiner or even as a category column if you are planning to use the Product Catalog model.

So you’ll find a lot of articles explaining how you can deploy Managed Metadata Fields declarative in SharePoint, but they are scattered, so I decided to aggregate all of the suggestions and tricks to cover this activity.

  • Taxonomy Field  declarative XML, no tricks here

    <Field ID=”{20A3C69E-FFFB-43F4-BBDF-2D22BAF0EB84}”
    Type=”TaxonomyFieldType”
    DisplayName=”$Resources:myResourceFile,EventType”
    ShowField=”Term1033″
    Required=”TRUE”
    EnforceUniqueValues=”FALSE”
    Group=”Custom”
    StaticName=”CustomEventType”
    Name=”CustomEventType”
    Filterable=”TRUE”
    Sortable=”TRUE” />

  • SharePoint creates a hidden note field to be field with chosen values even though filling the taxonomy field, right here comes the tricky element, although adding your custom field towards the list you must add this hidden field in addition to it, The Display name need to comply with the following convention ‘TaxonomyField_0′ and the static name should adhere to the following convention ‘TaxononmyFieldTaxHTField0′, without having following this conventions SharePoint search will not create the crawled property for your custom column ‘ows_taxId_CustomEventType’, and for certain will not generate the managed house

    ‘owstaxidKataraEventType’<Field ID=”{09F37A61-50FE-413E-941F-3BEE2A1B5BF8}”
    Name=”CustomEventTypeTaxHTField0″
    StaticName=”KataraEventTypeTaxHTField0″
    SourceID=”http://schemas.microsoft.com/sharepoint/v3/fields”
    Type=”Note”
    DisplayName=”CustomEventType_0″
    Group=”Katara”
    Hidden=”TRUE” />

  • Soon after declaring the schema of each field you must get them connected together, and ought to attach the developed column to a specific Term Set and distinct Term to choose from as a source, this could possibly be achived by adding a function event receiver making use of the following code snippet.SPSite site = properties.Feature.Parent as SPSite;

    Guid eventFieldId = new Guid(“{20A3C69E-FFFB-43F4-BBDF-2D22BAF0EB84}”);if (site.RootWeb.Fields.Contains(eventFieldId))
    {
    TaxonomySession session = new TaxonomySession(site);
    if (session.TermStores.Count != 0)
    {
    var termStore = session.TermStores["Managed Metadata Serivce"];
    var group = termStore.Groups["YOUR GROUP NAME"];
    var termSet = group.TermSets["YOUR TERM SET NAME"];var eventTypeTerm = termSet.Terms["THE TERM NAME CONTAINING YOUR VALUE"];

    TaxonomyField eventField = site.RootWeb.Fields[eventFieldId] as TaxonomyField;

    //Attach the note field to the taxonomy field
    eventField.TextField = new Guid(“{09F37A61-50FE-413E-941F-3BEE2A1B5BF8}”);

    // Connect to MMS
    eventField.SspId = termSet.TermStore.Id;
    eventField.TermSetId = termSet.Id;
    eventField.TargetTemplate = string.Empty;
    eventField.AnchorId = eventTypeTerm.Id;
    eventField.LookupWebId = site.RootWeb.ID;

    if (eventField.TypeAsString == “TaxonomyFieldTypeMulti”)
    ageGroupField.AllowMultipleValues = true;

    eventField.Update();
    }
    }

  • Within this stage we’ve got our field provisioned and added to our site as a web site column, the next step is usually to add it to a content sort, the trick here is we should add two hidden fields ‘TaxCatchAll’ & ‘TaxCatchAllLabel’ fields,If it doesn’t, then you won’t get facets showing up correctly in faceted search. Note that not having the TaxCatchAll and TaxCatchAllLabel pair of columns in your list or library or content variety can cause that.
  • so our field references will probably be like the following

    <FieldRef ID=”{20A3C69E-FFFB-43F4-BBDF-2D22BAF0EB84}” DisplayName=”$Resources:FILENAME_Columns,EventType;” Required=”TRUE” Name=”CustomEventType” Filterable=”TRUE” Sortable=”TRUE” />
    <FieldRef ID=”{09F37A61-50FE-413E-941F-3BEE2A1B5BF8}” DisplayName=”CustomEventType_0″ Hidden=”TRUE” Name=”CustomEventTypeTaxHTField0″ />
    <FieldRef ID=”{f3b0adf9-c1a2-4b02-920d-943fba4b3611}” DisplayName=”Taxonomy Catch All Column” Required=”FALSE” Hidden=”TRUE” Name=”TaxCatchAll” Sealed=”TRUE” Sortable=”FALSE” />
    <FieldRef ID=”{8f6b6dd8-9357-4019-8172-966fcd502ed2}” DisplayName=”Taxonomy Catch All Column1″ Required=”FALSE” Hidden=”TRUE” Name=”TaxCatchAllLabel” ReadOnly=”TRUE” Sealed=”TRUE” Sortable=”FALSE” />

  • Now we come to the next trick, referencing these columns to a list template within the schema.xml file , the trick right here would be to declare the TaxHiddenList ‘TaxCatchAll’ & ‘TaxCatchAllLabel’ correctly to the the list schema, these fields are a lookup columns so they need the information list (source), following is the definetion, NOTE the List attribute.

    <Field Type=”LookupMulti” DisplayName=”Taxonomy Catch All Column” StaticName=”TaxCatchAll” Name=”TaxCatchAll” ID=”{f3b0adf9-c1a2-4b02-920d-943fba4b3611}” ShowInViewForms=”FALSE” List=”Lists/TaxonomyHiddenList” Required=”FALSE” Hidden=”TRUE” CanToggleHidden=”TRUE” ShowField=”CatchAllData” SourceID=”{1e46f7fe-3764-40b5-abd1-1746c716214b}” Mult=”TRUE” Sortable=”FALSE” AllowDeletion=”TRUE” Sealed=”TRUE” Version=”2″ />
    <Field Type=”LookupMulti” DisplayName=”Taxonomy Catch All Column1″ StaticName=”TaxCatchAllLabel” Name=”TaxCatchAllLabel” ID=”{8f6b6dd8-9357-4019-8172-966fcd502ed2}” ShowInViewForms=”FALSE” List=”Lists/TaxonomyHiddenList” Required=”FALSE” Hidden=”TRUE” CanToggleHidden=”TRUE” ShowField=”CatchAllDataLabel” FieldRef=”{F3B0ADF9-C1A2-4b02-920D-943FBA4B3611}” SourceID=”{1e46f7fe-3764-40b5-abd1-1746c716214b}” ReadOnly=”TRUE” Mult=”TRUE” Sortable=”FALSE” AllowDeletion=”TRUE” Sealed=”TRUE” Version=”2″ />

  • Finally, we require to attache the “TaxonomyItemSynchronousAddedEventReceiver” & “TaxonomyItemUpdatingEventReceiver” to update all the hidden fields.

    <Receiver>
    <Name>TaxonomyItemSynchronousAddedEventReceiver</Name>
    <Type>ItemAdding</Type>
    <Assembly>Microsoft.SharePoint.Taxonomy, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c</Assembly>
    <Class>Microsoft.SharePoint.Taxonomy.TaxonomyItemEventReceiver</Class>
    <SequenceNumber>10000</SequenceNumber>
    </Receiver>
    <Receiver>
    <Name>TaxonomyItemUpdatingEventReceiver</Name>
    <Type>ItemUpdating</Type>
    <Assembly>Microsoft.SharePoint.Taxonomy, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c</Assembly>
    <Class>Microsoft.SharePoint.Taxonomy.TaxonomyItemEventReceiver</Class>
    <SequenceNumber>10000</SequenceNumber>
    </Receiver>

Best Recommended SharePoint 2013 Hosting

ASPHostPortal.com
ASPHostPortal.com is Perfect, suitable hosting plan for a starter in SharePoint. ASPHostPortal  the leading provider of Windows hosting and affordable SharePoint Hosting. ASPHostPortal proudly working to help grow the backbone of the Internet, the millions of individuals, families, micro-businesses, small business, and fledgling online businesses. ASPHostPortal has ability to support the latest Microsoft and ASP.NET technology, such as: WebMatrix, WebDeploy, Visual Studio 2015, .NET 5/ASP.NET 4.5.2, ASP.NET MVC 6.0/5.2, Silverlight 6 and Visual Studio Lightswitch, ASPHostPortal guarantees the highest quality product, top security, and unshakeable reliability, carefully chose high-quality servers, networking, and infrastructure equipment to ensure the utmost reliability

SharePoint 2013 Hosting :: How To Update Conflict Error in SharePoint Using PowerShell Script

Hi guys this article explains you about How To Update Conflict Error in SharePoint Using PowerShell Script. Many of you must have come across the issue “An update conflict has occurred and you must re-try this action” and it is suggested to remove the file system cache on the front-end servers. There are many articles to show how to do this manually. But here I will show you how to resolve it using a PowerShell script.

Cause for this issue

This issue occurs if the contents of the file system cache on the front-end servers are newer than the contents of the configuration database.

Resolution

To resolve this issue, clear the file system cache on all servers in the server Farm on which the Windows SharePoint Services Timer service is running. This can be done manually, but consider a large Farm where the administrator needs to login to each of the servers to perform the activity manually. It is time-consuming and people can make mistakes. PowerShell becomes handy here.

The following procedure can resolve the issue:

  1. Stop the SharePoint timer service
  2. Take a backup of the system cache files before deleting it
  3. Delete the XML files from the cache folder
  4. Reset the cache.ini file to the value 1
  5. Start the SharePoint timer service

Now I will explain how to perform the preceding tasks using a PowerShell script.

  • Stop SharePoint timer service

The following piece of code stops the SharePoint timer service:

    Function StopSPTimerServicesInFarm([Microsoft.SharePoint.Administration.SPFarm]$farm)  
    {  
        Write-Host ""  
        foreach($server in $farm.Servers)  
            {  
            foreach($instance in $server.ServiceInstances)  
                    {  
                            # If the server has the timer service then stop the service  
                           if($instance.TypeName -eq $timerServiceInstanceName)  
                           {  
                                [string]$serverName = $server.Name  
       
                                Write-Host "Stop " $timerServiceName " service on server: " $serverName -fore yellow  
                                   
                                $service = Get-WmiObject -ComputerName $serverName Win32_Service -Filter "DisplayName='$timerServiceName'"  
                                $serviceInternalName = $service.Name  
                                sc.exe \\$serverName stop $serviceInternalName > $null  
      
                                  # Wait until this service has actually stopped  
                      write-host "Waiting for '$timerServiceName' service on server: " $serverName " to be stopped" -fore yellow  
                                  do  
                          {  
                                  Start-Sleep 1  
                                  Write-Host -foregroundcolor DarkGray -NoNewLine "."  
                                  $service = Get-WmiObject -ComputerName $serverName Win32_Service -Filter "DisplayName='$timerServiceName'"  
                          }  
                         while ($service.State -ne "Stopped")  
                     write-host " '$timerServiceName' service on server: " $serverName " stopped successfully" -fore green              
                                 break;  
                           }  
                    }  
            }  
       
            Write-Host ""  
    }
  • Backup config cache files

The following piece of code backs up the config cache files before deleting it:

Function BackupSPConfigFiles([Microsoft.SharePoint.Administration.SPFarm]$farm)  
{  
    write-host ""  
    write-host "Backup SP config cache files" -fore yellow  
      
    foreach($server in $farm.servers)  
    {  
        foreach($instance in $server.ServiceInstances)  
        {  
            if($instance.TypeName -eq $timerServiceInstanceName)  
            {  
                $ServerName = $server.name  
                $FolderName  = $servername + "SPConfigCacheBackup"  
                write-host "Creating a folder to hold the backup files" -fore magenta  
                write-host "Checking whether the folder aleady exist"  
                if(Test-path $scriptbase\$FolderName)  
                {  
                    write-host "Folder already exists and the script is deleting it......"  
                    remove-item $scriptbase\$FolderName -recurse -confirm:$false   
                    write-host "Existing folder deleted" -fore green  
                }  
                else  
                {  
                    write-host "Folder does not exist"  
                }  
                New-Item $scriptbase\$FolderName -type directory  
                write-host "New folder created to hold the backup files" -fore magenta  
                write-host "Backup of SP config files for the server " $serverName " started ...... " -fore yellow  
                $path = "\\" + $serverName + "\c$\ProgramData\Microsoft\SharePoint\Config"  
                Copy-Item $path -Destination $scriptbase\$FolderName -recurse  
                write-host "SP config cache files backed up for the server " $serverName " Sucessfully..." -fore green  
            }  
        }  
    }  
    write-host "SP config caches files are backed up" -fore green  
    write-host ""  
}
  • Deleting XML files

The following piece of code deletes the XML files:

    Function DeletingXMLFiles([Microsoft.SharePoint.Administration.SPFarm]$farm)  
    {  
        Write-host ""  
        write-host "Deleting SP config cache XML files from each server in the farm" -fore yellow  
        $path = ""  
        foreach($server in $farm.servers)  
        {  
            foreach($instance in $server.ServiceInstances)  
            {  
                if($instance.TypeName -eq $timerServiceInstanceName)  
                {  
                    $serverName = $server.Name  
                    write-host "Deleting SP config cache files from the server " $servername -fore magenta  
                    $path = "\\" + $serverName + "\c$\ProgramData\Microsoft\SharePoint\Config\*-*\*.xml"  
                    remove-item -path $path -force  
                    write-host "SP config cache files deleted on the server " $servername -fore magenta  
                    break  
                }  
            }  
        }  
        write-host "SP config cache XML files from each server in the farm is deleted successfully......" -fore green  
        write-host ""  
    }
  • Reset timer cache

The following piece of code resets the timer cache:

Function ResetTimerCache([Microsoft.SharePoint.Administration.SPFarm]$farm)  
{  
    write-host ""  
    write-host "Reseting the value of timer cache to 1" -fore yellow  
    $path = ""  
    foreach($server in $farm.servers)  
    {  
        foreach($instance in $server.ServiceInstances)  
        {  
            if($instance.TypeName -eq $timerServiceInstanceName)  
            {  
                $serverName = $server.Name  
                write-host "Reseting the value of timer cache file in server " $serverName -fore magenta  
                $path = "\\" + $serverName + "\c$\ProgramData\Microsoft\SharePoint\Config\*-*\cache.ini"  
                Set-Content -path $path -Value "1"  
                write-host "Value of timer cache file in server " $serverName " is resetted to 1" -fore magenta  
                break  
            }  
        }  
    }  
    write-host "The value of timer cache is resetted to 1 in all the SP servers in the farm" -fore green  
    write-host ""  
}
  • Start SharePoint timer service
    Function StartSPTimerServicesInFarm([Microsoft.SharePoint.Administration.SPFarm]$farm)  
    {  
        Write-Host ""  
        foreach($server in $farm.Servers)  
            {  
            foreach($instance in $server.ServiceInstances)  
                    {  
                            # If the server has the timer service then stop the service  
                           if($instance.TypeName -eq $timerServiceInstanceName)  
                           {  
                                [string]$serverName = $server.Name  
       
                                Write-Host "Start " $timerServiceName " service on server: " $serverName -fore yellow  
                                   
                                $service = Get-WmiObject -ComputerName $serverName Win32_Service -Filter "DisplayName='$timerServiceName'"  
                                $serviceInternalName = $service.Name  
                                sc.exe \\$serverName start $serviceInternalName > $null  
      
                                  # Wait until this service starts running  
                      write-host "Waiting for " $timerServiceName " service on server: " $serverName " to be started" -fore yellow  
                                  do  
                          {  
                                  Start-Sleep 1  
                                  Write-Host -foregroundcolor DarkGray -NoNewLine "."  
                                  $service = Get-WmiObject -ComputerName $serverName Win32_Service -Filter "DisplayName='$timerServiceName'"  
                          }  
                         while ($service.State -ne "Running")  
                     write-host $timerServiceName " service on server: " $serverName " started successfully" -fore green              
                                 break;  
                           }  
                    }  
            }  
       
            Write-Host ""  
    }
  • Complete Code
    $LogTime = Get-Date -Format yyyy-MM-dd_hh-mm  
    $LogFile = ".\ClearSPConfigCachePatch-$LogTime.rtf"  
    # Add SharePoint PowerShell Snapin  
    if ( (Get-PSSnapin -Name Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue) -eq $null ) {  
        Add-PSSnapin Microsoft.SharePoint.Powershell  
    }  
    $scriptBase = split-path $SCRIPT:MyInvocation.MyCommand.Path -parent  
    Set-Location $scriptBase  
    #Deleting any .rtf files in the scriptbase location  
    $FindRTFFile = Get-ChildItem $scriptBase\*.* -include *.rtf  
    if($FindRTFFile)  
    {  
        foreach($file in $FindRTFFile)  
            {  
                remove-item $file  
            }  
    }      
    start-transcript $logfile  
    Write-host "##############Following steps will be involved################" -fore green  
    write-host "Step 1 - Stop the timerservice" -fore cyan  
    write-host "Step 2 - Take the backup of config cache file" -fore cyan  
    write-host "Step 3 - Delete the XML files" -fore cyan  
    write-host "Step 4 - Reset the cache.ini file" -fore cyan  
    write-host "Step 5 - Start the SP timerservice" -fore cyan  
    Write-host "##############Above steps will be involved##################" -fore green  
      
    $global:timerServiceName = "SharePoint 2010 Timer"  
    $global:timerServiceInstanceName = "Microsoft SharePoint Foundation Timer"  
   
    # Get the local farm instance  
    [Microsoft.SharePoint.Administration.SPFarm]$farm = [Microsoft.SharePoint.Administration.SPFarm]::get_Local()  
    Function StopSPTimerServicesInFarm([Microsoft.SharePoint.Administration.SPFarm]$farm)  
    {  
        Write-Host ""  
        foreach($server in $farm.Servers)  
            {  
            foreach($instance in $server.ServiceInstances)  
                    {  
                            # If the server has the timer service then stop the service  
                           if($instance.TypeName -eq $timerServiceInstanceName)  
                           {  
                                [string]$serverName = $server.Name  
       
                                Write-Host "Stop " $timerServiceName " service on server: " $serverName -fore yellow  
                                   
                                $service = Get-WmiObject -ComputerName $serverName Win32_Service -Filter "DisplayName='$timerServiceName'"  
                                $serviceInternalName = $service.Name  
                                sc.exe \\$serverName stop $serviceInternalName > $null  
      
                                  # Wait until this service has actually stopped  
                      write-host "Waiting for '$timerServiceName' service on server: " $serverName " to be stopped" -fore yellow  
                                  do  
                          {  
                                  Start-Sleep 1  
                                  Write-Host -foregroundcolor DarkGray -NoNewLine "."  
                                  $service = Get-WmiObject -ComputerName $serverName Win32_Service -Filter "DisplayName='$timerServiceName'"  
                          }  
                         while ($service.State -ne "Stopped")  
                     write-host " '$timerServiceName' service on server: " $serverName " stopped successfully" -fore green              
                                 break;  
                           }  
                    }  
            }  
       
            Write-Host ""  
    }  
    Function BackupSPConfigFiles([Microsoft.SharePoint.Administration.SPFarm]$farm)  
    {  
        write-host ""  
        write-host "Backup SP config cache files" -fore yellow  
          
        foreach($server in $farm.servers)  
        {  
            foreach($instance in $server.ServiceInstances)  
            {  
                if($instance.TypeName -eq $timerServiceInstanceName)  
                {  
                    $ServerName = $server.name  
                    $FolderName  = $servername + "SPConfigCacheBackup"  
                    write-host "Creating a folder to hold the backup files" -fore magenta  
                    write-host "Checking whether the folder aleady exist"  
                    if(Test-path $scriptbase\$FolderName)  
                    {  
                        write-host "Folder already exists and the script is deleting it......"  
                        remove-item $scriptbase\$FolderName -recurse -confirm:$false   
                        write-host "Existing folder deleted" -fore green  
                    }  
                    else  
                    {  
                        write-host "Folder does not exist"  
                    }  
                    New-Item $scriptbase\$FolderName -type directory  
                    write-host "New folder created to hold the backup files" -fore magenta  
                    write-host "Backup of SP config files for the server " $serverName " started ...... " -fore yellow  
                    $path = "\\" + $serverName + "\c$\ProgramData\Microsoft\SharePoint\Config"  
                    Copy-Item $path -Destination $scriptbase\$FolderName -recurse  
                    write-host "SP config cache files backed up for the server " $serverName " Sucessfully..." -fore green  
                }  
            }  
        }  
        write-host "SP config caches files are backed up" -fore green  
        write-host ""  
    }  
    Function DeletingXMLFiles([Microsoft.SharePoint.Administration.SPFarm]$farm)  
    {  
        Write-host ""  
        write-host "Deleting SP config cache XML files from each server in the farm" -fore yellow  
        $path = ""  
        foreach($server in $farm.servers)  
        {  
            foreach($instance in $server.ServiceInstances)  
            {  
                if($instance.TypeName -eq $timerServiceInstanceName)  
                {  
                    $serverName = $server.Name  
                    write-host "Deleting SP config cache files from the server " $servername -fore magenta  
                    $path = "\\" + $serverName + "\c$\ProgramData\Microsoft\SharePoint\Config\*-*\*.xml"  
                    remove-item -path $path -force  
                    write-host "SP config cache files deleted on the server " $servername -fore magenta  
                    break  
                }  
            }  
        }  
        write-host "SP config cache XML files from each server in the farm is deleted successfully......" -fore green  
        write-host ""  
    }  
    Function ResetTimerCache([Microsoft.SharePoint.Administration.SPFarm]$farm)  
    {  
        write-host ""  
        write-host "Reseting the value of timer cache to 1" -fore yellow  
        $path = ""  
        foreach($server in $farm.servers)  
        {  
            foreach($instance in $server.ServiceInstances)  
            {  
                if($instance.TypeName -eq $timerServiceInstanceName)  
                {  
                    $serverName = $server.Name  
                    write-host "Reseting the value of timer cache file in server " $serverName -fore magenta  
                    $path = "\\" + $serverName + "\c$\ProgramData\Microsoft\SharePoint\Config\*-*\cache.ini"  
                    Set-Content -path $path -Value "1"  
                    write-host "Value of timer cache file in server " $serverName " is resetted to 1" -fore magenta  
                    break  
                }  
            }  
        }  
        write-host "The value of timer cache is resetted to 1 in all the SP servers in the farm" -fore green  
        write-host ""  
    }  
    Function StartSPTimerServicesInFarm([Microsoft.SharePoint.Administration.SPFarm]$farm)  
    {  
        Write-Host ""  
        foreach($server in $farm.Servers)  
            {  
            foreach($instance in $server.ServiceInstances)  
                    {  
                            # If the server has the timer service then stop the service  
                           if($instance.TypeName -eq $timerServiceInstanceName)  
                           {  
                                [string]$serverName = $server.Name  
       
                                Write-Host "Start " $timerServiceName " service on server: " $serverName -fore yellow  
                                   
                                $service = Get-WmiObject -ComputerName $serverName Win32_Service -Filter "DisplayName='$timerServiceName'"  
                                $serviceInternalName = $service.Name  
                                sc.exe \\$serverName start $serviceInternalName > $null  
      
                                  # Wait until this service starts running  
                      write-host "Waiting for " $timerServiceName " service on server: " $serverName " to be started" -fore yellow  
                                  do  
                          {  
                                  Start-Sleep 1  
                                  Write-Host -foregroundcolor DarkGray -NoNewLine "."  
                                  $service = Get-WmiObject -ComputerName $serverName Win32_Service -Filter "DisplayName='$timerServiceName'"  
                          }  
                         while ($service.State -ne "Running")  
                     write-host $timerServiceName " service on server: " $serverName " started successfully" -fore green              
                                 break;  
                           }  
                    }  
            }  
       
            Write-Host ""  
    }         
    #############Calling functions################  
    StopSPTimerServicesInFarm $farm  
    BackupSPConfigFiles $farm  
    DeletingXMLFiles $farm  
    ResetTimerCache $farm  
    StartSPTimerServicesInFarm $farm  
    ##########################################    
    write-host "SCRIPT COMPLETED" -fore cyan  
    stop-transcript

Execution Procedure

  1. Step 1: Download the script and copy it to the SharePoint server.
  2. Step 2: Navigate to the script path.
  3. Step 3: Execute the script.

Best Recommended SharePoint 2013 Hosting

ASPHostPortal.com

ASPHostPortal.com is Perfect, suitable hosting plan for a starter in SharePoint. ASPHostPortal  the leading provider of Windows hosting and affordable SharePoint Hosting. ASPHostPortal proudly working to help grow the backbone of the Internet, the millions of individuals, families, micro-businesses, small business, and fledgling online businesses. ASPHostPortal has ability to support the latest Microsoft and ASP.NET technology, such as: WebMatrix, WebDeploy, Visual Studio 2015, .NET 5/ASP.NET 4.5.2, ASP.NET MVC 6.0/5.2, Silverlight 6 and Visual Studio Lightswitch, ASPHostPortal guarantees the highest quality product, top security, and unshakeable reliability, carefully chose high-quality servers, networking, and infrastructure equipment to ensure the utmost reliability

 

 

 

SharePoint 2013 Hosting :: Duplicate Web Part Issue in SharePoint 2013

Today for something regarding one of the new features of SharePoint 13. There is the new attribute “ReplaceContent=TRUE” for the <File> element in <Module>.

Until SharePoint 2010, whenever we reactivate the PageLayout feature (the feature that provisions the page layouts in a master page gallery), web parts that have been added to the page layout are duplicated on the new page and we do not have a very standard solution to resolve this problem except for writing a feature receiver and removing the duplicated web parts.

ahp banner sharepoint-01
In SharePoint 2013 is the new attribute “ReplaceContent=TRUE” of the <File> element and if we use this when provisioning the page layout it overrides the existing web parts on the page layouts. So whenever we create a new page from the given page layouts, web parts are not duplicated.

    <Elements xmlns="http://schemas.microsoft.com/sharepoint/">  
      <Module Name="MyPageLayouts" Url="_catalogs/masterpage" RootWebOnly="TRUE">  
        <File Path="MyPageLayouts\MyPageLayout.aspx" Url="MyPageLayouts.Intranet/MyPageLayout.aspx" Type="GhostableInLibrary" ReplaceContent="TRUE">       
    <!—- All our web parts goes here -->  
        </File>  
      </Module>

Have a look at the preceding example, I have set the ReplaceContent=”TRUE”. Because of this whenever I change, add or delete a web part in this elements.xml file and I need to reactivate the feature, the web parts on the page layouts are not duplicated but they do get overridden.

Other Usage example

I’ll like to share one more scenario related to this, I have a sandbox solution that I am deploying on Office 365. I was uploading my package file (.wsp) to the Solution Gallery and activating it. In my package I have one feature that is deploying my CSS file in the master page gallery since I do not have file system access. I had a change in CSS file, I did the change, packaged the solution, deactivated the solution first, uploaded it to the solution gallery and activated it. But my CSS changes are not reflected. Then I remembered the “ReplaceContent” attribute and I used it in the module element while provisioning the CSS file and wonder happened? It worked like a charm.

Feel free if you have some thoughts on this or please share your experience. Thanks :)

Best Recommended SharePoint 2013 Hosting

ASPHostPortal.com

ASPHostPortal.com is Perfect, suitable hosting plan for a starter in SharePoint. ASPHostPortal  the leading provider of Windows hosting and affordable SharePoint Hosting. ASPHostPortal proudly working to help grow the backbone of the Internet, the millions of individuals, families, micro-businesses, small business, and fledgling online businesses. ASPHostPortal has ability to support the latest Microsoft and ASP.NET technology, such as: WebMatrix, WebDeploy, Visual Studio 2015, .NET 5/ASP.NET 4.5.2, ASP.NET MVC 6.0/5.2, Silverlight 6 and Visual Studio Lightswitch, ASPHostPortal guarantees the highest quality product, top security, and unshakeable reliability, carefully chose high-quality servers, networking, and infrastructure equipment to ensure the utmost reliability

 

 

SharePoint 2013 Hosting :: How To Retrieve Followed Sites in SharePoint 2013 Using REST API

This article explains how to retrieve the site name and URL followed by the current user in SharePoint 2013 using a client object model (REST API and JavaScript)

We can use the SharePoint 2013 Representational State Transfer (REST) service to do the same tasks you can do when you use the .NetCSOM, JSOM.
Here I explain how to retrieve the site name and URL followed by the current user in SharePoint 2013 using a client object model (REST API and JavaScript) and displaying it in the SharePoint page.

  • Create a new page and a Content Editor Webpart (CEWP)

Create a New page

  • Edit the web part that was added to the page.
  • Upload your text file script into the site assests and copy the path of the text file and paste it into the Content link in CEWP.

Code

The following example shows how to retrieve all of the following sites:

<html>    
    <head>    
       <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>    
          <script type="text/javascript">  
             var followingManagerEndpoint;  
             var followedCount; 
             var followingEndpoint;    
             var URL;    
             var website;    
             var clientContext;  
             SP.SOD.executeFunc('sp.js', 'SP.ClientContext', loadWebsite);    
             function loadWebsite() {    
                clientContext = SP.ClientContext.get_current();    
                website = clientContext.get_web();    
                clientContext.load(website);    
                clientContext.executeQueryAsync(onRequestSucceeded, onRequestFailed);    
             }    
             function onRequestSucceeded() {   
               URL = website.get_url();    
               followingManagerEndpoint = decodeURIComponent(URL) + "/_api/social.following";   
               getMyFollowedContent();  
            }    
            function onRequestFailed(sender, args) {    
              alert('Error: ' + args.get_message());    
            }   
            // Get the content that the current user is following.  
            // The "types=14" parameter specifies all content types  
            // (documents = 2 + sites = 4 + tags = 8).  
           function getMyFollowedContent() {  
             $.ajax( {  
                  url: followingManagerEndpoint + "/my/followed(types=14)",  
                  headers: {   
                      "accept": "application/json;odata=verbose"  
                  },  
                  success: followedContentRetrieved,  
                  error: requestFailed  
            });  
         }  
         // Parse the JSON data and iterate through the collection.  
         function followedContentRetrieved(data) {  
             var stringData = JSON.stringify(data);  
             var jsonObject = JSON.parse(stringData);   
             var types = {  
               1: "document",  
               2: "site",  
               3: "tag"   
            };  
            var followedActors = jsonObject.d.Followed.results;   
            var followedList = "You're following items:";  
            for (var i = 0; i < followedActors.length; i++) {  
               var actor = followedActors[i];  
               followedList += "<p>The " + types[actor.ActorType] + ": \"" +actor.Name + "\"</p>"+"<p>Site URL " + ": \"" +  
               actor.Uri+ "\"</p>";;  
            }   
            $("#Follow").html(followedList);   
         }  
         function requestFailed(xhr, ajaxOptions, thrownError) {  
           alert('Error:\n' + xhr.status + '\n' + thrownError + '\n' + xhr.responseText);  
         }  
       </script>    
    </head>    
 <body>    
 <div id="Follow"></div>    
 </body>    
 </html>

Happy Coding :)

Best Recommended SharePoint 2013 Hosting

ASPHostPortal.com

ASPHostPortal.com is Perfect, suitable hosting plan for a starter in SharePoint. ASPHostPortal  the leading provider of Windows hosting and affordable SharePoint Hosting. ASPHostPortal proudly working to help grow the backbone of the Internet, the millions of individuals, families, micro-businesses, small business, and fledgling online businesses. ASPHostPortal has ability to support the latest Microsoft and ASP.NET technology, such as: WebMatrix, WebDeploy, Visual Studio 2015, .NET 5/ASP.NET 4.5.2, ASP.NET MVC 6.0/5.2, Silverlight 6 and Visual Studio Lightswitch, ASPHostPortal guarantees the highest quality product, top security, and unshakeable reliability, carefully chose high-quality servers, networking, and infrastructure equipment to ensure the utmost reliability