SharePoint (2003 thru Online)

Friday, February 26, 2016

SharePoint 2010 & 2007 – Clearing the Configuration Cache

There were many common issues that could occur in WSS v3 and MOSS that would require you to clear the configuration cache on your servers. While less common, these issues can still turn up occasionally on SharePoint Server 2010 (And Foundation). While the resolution for these issues might be the same, the steps are a bit different. The main thing to note is that the Configuration Cache is located in a different directory on Windows Server 2008 then it was in Windows Server 2003.

The new path for the Configuration Cache under Windows Server 2008 is: %SystemDrive%\ProgramData\Microsoft\SharePoint\Config\<GUID> The overall steps remain largely the same:

Stop the Timer service. To do this, follow these steps:

Click
Start, point to Administrative Tools, and then click Services.
Right-click SharePoint 2010 Timer, and then click Stop.
Minimise the Services console. 

On the computer that is running Microsoft SharePoint Server 2010 and on which the Central Administration site is hosted, click Start, click Run, type explorer, and then press ENTER.
In Windows Explorer, locate and then double-click the following folder:
%SystemDrive%\ProgramData\Microsoft\SharePoint\Config\GUID

Note: The %SystemDrive% system variable specifies the letter of the drive on which Windows is installed. By default, Windows is installed on drive C.
The GUID placeholder specifies the GUID folder. There may be more than one of these.
The ProgramData folder may be hidden. To view the hidden folder, follow these steps:
On the Tools menu, click Folder Options.
Click the View tab.
In the Advanced settings list, click Show hidden files and folders under Hidden files and folders, and then click OK.
You can also simply type this directly in the path if you do not want to show hidden files and folders. 

Back up the Cache.ini file. (Make a copy of it. DO NOT DELETE THIS FILE, Only the XML files in the next step)
Delete all the XML configuration files in the GUID folder (DO NOTE DELETE THE FOLDER). Do this so that you can verify that the GUID folders content is replaced by new XML configuration files when the cache is rebuilt.

Note: When you empty the configuration cache in the GUID folder, make sure that you do NOT delete the GUID folder and the Cache.ini file that is located in the GUID folder.
Double-click the Cache.ini file.
On the Edit menu, click Select All.
On the Edit menu, click Delete.
Type 1, and then click Save on the File menu. (Basically when you are done, the only text in the config.ini file should be the number 1)
On the File menu, click Exit.

Start the Timer service. To do this, follow these steps:

Click Start, point to Administrative Tools, and then click Services.
Right-click SharePoint 2010 Timer, and then click Start.
Close the Services console.

Note: The file system cache is re-created after you perform this procedure. Make sure that you perform this procedure on all servers in the server farm.
Make sure that the Cache.ini file in the GUID folder now contains its previous value. For example, make sure that the value of the Cache.ini file is not 1.

Check in the GUID folder to make sure that the xml files are repopulating. This may take a bit of time.

For the original steps for clearing out the configuration cache in SharePoint 2007, there are many articles that cover the steps, one of them is the following: http://support.microsoft.com/kb/939308

Friday, February 5, 2016

Prompt Users login again and again - [DMZ Servers - Firewall]

Problem: Even though you type in correct username and password, it will prompt the login box again and again. 

Many organizations have DMZ environment to serve External Clients and Vendors. The SharePoint environment is the key to make easy access websites and share. Many cases, internal users also will be having access to these DMZ SharePoint Sites.

Firewall plays the security role to allow authentication between Internal Users and DMZ SharePoint sites. When Firewall is busy or down, it will not authenticated and will not allow Internal Users to access the DMZ SharePoint sites. It behaves the same as like your account was locked.


The Solution is make sure the Firewall is up and running and also make sure, in IIS Manager >> Application Pools, SecurityTokenServiceApplicationPool is started. Also make sure the Account used to run the App Pool is not locked.

If you still see issues, recycle the SecurityTokenServiceApplicationPool

This should fix the issue of Users login Failure or prompt the login box again and again.

There are only few scenarios where users will be unable to login into the site.

1. When User's Account was locked.
2. When Firewall blocks the Authentication request from User.
3. When AD does not respond to authenticate the User Account.

Thursday, January 21, 2016

Solution Package retracting stuck: SharePoint 2007

Problem: We were planning to retract an errored solution and re-deploy for one of our web applications.

However, as we all know we have to first retract the solution from the web application and for that we use the stsadm command line given below, 

stsadm -o retractsolution -name solutionName.wsp –immediate followed by STSADM -o execadmsvcjobs
We have waited for min 20 min, but after refreshing the CA for many times we have seen the solution was stuck in retract state.

Troubleshooting: We checked the status of ‘Windows SharePoint Services Solution Retraction for’ timer job and It was successful for all of the servers we have in the environment.

To check the status of the above Timer Service,
  • Go to Central Administration
  • Navigate to Operations >> Global Configuration >> Timer job status.
  • Look for Jobs name starting with either "Windows SharePoint Services Solution Retraction for".

Resolution: we have tried running ‘execadmsvsjobs’ STSADM command.

STSADM -o execadmsvcjobs ( On all the Servers ).

To all of the servers in the env. And refreshing CA the status of the solution package was ‘not deployed’.

Some other things you can also try to resolve the problems are.
  • Restarting the OWSTIMER Service.
  • Deleting the Job Timer Definition for some reasons resolves it. (this worked for me in both cases - stuck retracting and stuck deploying).
  • Restarting the machine and try one more time.

Friday, January 8, 2016

Search Service Account - MOSS 2007 (Password Reset)

When are reset password for the Search Service Account, you need to make sure you change the password on the Services running with this account on all Servers.

Also you need to verify in Central Administration >> Shared Service Admin >> SSP >> Search Administration, If you are using this account as "Default Content Access Account", you need to click on it and update the new password.

If you have more than one SSP, you  need to perform this activity on all SSPs.

Also verify the Services. Central Admin >> Operations >> Services on Server.
Stop and Start the Services, which requires you to update the new Password.



Wednesday, January 6, 2016

SharePoint Servers


SharePoint : Farm
A Farm or Server Farm is a group of servers that share the same administrative tools and are part of the same organization or group.
It can be done (web/datababase/index etc) on a single server in “Simple Installation” mode in which case you don’t need a NLB. For many small businesses this is plenty enough. Medium sized businesses usually start with at least 2 Web Front Ends (WFE’s) and a database server. Multinationals can have some very complex setups involving dozens of components.

SharePoint : Web Front End server (WFE)

A web server that handles web page requests from users, processes the request and returns the data. They process HTTP/S traffic and rely on Internet Information Server (IIS) to provide much of the web server 'stack'
In a farm there can be multiple Web Front End (WFE) servers and a Network Load Balancer (NLB) will distribute requests between them. This is the primary method of scaling in SharePoint - as the number of users grows you add more WFE servers. Is also used to add redundancy - If a WFE fails the NLB can distribute requests to other WFE's.

SharePoint : Application Server

An Application Server is a computer that provides key infrastructure and services for applications that are hosted on a farm.
Typically - in SharePoint this means that a server that has been assigned to run duties such as Excel, Visio or Access Services or Index/Search services - as opposed to general web server duties of a Web Front End server.

SharePoint : Index / Search Server

An Index Server is assigned the task of 'crawling' your content and building up an Index of key words and phrases. A Search Server then uses this index to respond to user searches and suggest results.
By pre-indexing content ahead of a search being performed results from a huge number (billions) of documents and web pages can be displayed extremely quickly. If the search was performed 'on demand' it could take hours for result to be collated. (This is exactly the same way that Internet search engines work).
In SharePoint you can have all services (web, database, index, search and application) on a single server in a small installation but indexing (and to a lesser extent) search services are often put on their own server. In a large installation you can have several index and search servers.

Profile Import Errors (Forefront Identity Manager Synchronization Service)

ISSUE
After setting up User Profile Service Application and configuring the synchronization connection to your active directory you receive the following error in Application Log of the Server running FIMSynchronizationService (In our case this is APP Server).

The management agent “MOSSAD-DEC” failed on run profile “DS_FULLIMPORT” because of connectivity issues. Event Id 6050



For further investigation use the MIISClient.exe tool located in “C:\Program Files\Microsoft Office Servers\14.0\Synchronization Service\UIShell” on the operations TAB you also see the following error under (DS_FULLIMPORT)  Status: stopped-conectivity.

failed-search    Replication access was denied    8453 (Error Code)



Resolution

Verify and Confirm that the service account used to run Forefront Identity Manager Synchronization Service (FIMSynchronizationService) has the AD Security right of “Replicating Directory Changes” at the Domain Level.

1. Open the "Active Directory Users and Computers" snap-in
2. On the View menu, click "Advanced Features".
3. Right-click the domain object, such as “ou.domain.com”, and then click "Properties".
4. On the Security tab, if the desired user account is not listed, click Add; if the desired user account is listed, proceed to step 7.
5. In the Select Users, Computers, or Groups dialog box, select the desired user account, and then click Add.
6. Click OK to return to the Properties dialog box.
7. Click the desired user account.
8. Click to select the "Replicating Directory Changes" check box from the list.
9. Click Apply, and then click OK.
10. Close the snap-in.

NOTE: Group “Domain Admins” already has the above right however if you are still seeing this issue add the service account explicitly to the AD Security.

Even after applying the above Steps, we may still see the problem some times.
Perform the below steps with the help of your Systems Admin, if you don't have access to Domains/Domain Controllers.

Use this procedure to grant Replicate Directory Changes permission on the CN=Configuration container to an account.
  1. On the domain controller, click Start, click Run, type adsiedit.msc, and then click OK.
  2. If the Configuration node is not already present, do the following:
    1. In the navigation pane, click ADSI Edit.
    2. On the Action menu, click Connect to.
    3. In the Connection Point area of the Connection Settings dialog box, click Select a well know Naming Context, select Configuration from the drop-down list, and then click OK.
  3. Expand the Configuration node, right-click the CN=Configuration... node, and then click Properties.
  4. In the Properties dialog box, click the Security tab.
  5. In the Group or user names section, click Add.
  6. Type the name of the synchronization account, and then click OK.
  7. In the Group or user names section, select the synchronization account.
  8. In the Permissions section, select the Allow check box next to the Replicating Directory Changes (Replicate Directory Changes on Windows Server 2003) permission, and then click OK.
After following all these steps, Full Synchronization was completed successfully with Profile Import.

Thursday, December 10, 2015

SharePoint Servers (FARM) Reboot Hierarchy

We would recommend this order as it will minimize the number of warnings/errors in the Windows Event Log. This is applicable to all (SharePoint 2003, 2007, 2010, 2013 & 2016).

Shutting down the SP Servers (FARM)


1. WFE Servers
2. Index and Search Servers
3. App Servers (the App server that runs Central Administration web site last)
4. SQL Servers



Turning on the SP Servers (FARM) 
[we can use the below hierarchy for re-boot also]


1. SQL Servers
2. App Servers (the App server that runs Central Administration web site first)
3. Index and Search Servers
4. WFE Servers

Friday, October 23, 2015

Clearing Logs in SharePoint 2010 Front End Server

Clearing Logs in SharePoint 2010 FE Server

We have two different logs. One from SharePoint and one from IIS.



SharePoint 2010 Logs:
C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\LOGS

IIS Logs:
C:\inetpub\logs\LogFiles 

The logs grow enormously and occupy most of the drive space on the Front End Server. This may affect the performance of the Server as all the Transactions are looped thru it.

To control the log files growing, we want to create Scheduled Tasks to delete the logs older than 4 days.

1. Delete SP Log more than 4 days

Created a VB Script file with below code and placed it in a Folder "Scripts" folder on C:\ Drive.

'DelSPLogs.vbs - August 19, 2013
'Venugopal Reddy Gurram
'Deletes SharePoint Logs more than 4 days

Dim i, fso, f, f1, sf, BasePath, CalcResult, fNameArray()
BasePath = "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\LOGS"
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFolder(BasePath)
Set sf = f.SubFolders
For Each f1 in sf
     CalcResult = DateDiff("d",f1.DateCreated,Now)
          if CalcResult > 4 then
                ReDim preserve fNameArray(i)
                fNameArray(i) = f1.Name
                i = i + 1
        end if
Next

For Each fName in fNameArray
    FSO.DeleteFolder(BasePath & "\" & fName)
Next


2. Delete .usage Files more than 4 days.

We need to perform this activity manually.

Stop the "SharePoint 2010 Timer" service and start deleting the usage files in below folder.

SharePoint 2010 Logs:
C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\LOGS

Once Completed deletion, start the "SharePoint 2010 Timer" service

Thursday, October 22, 2015

List of all user/group rights for a SharePoint Web Application


The following T-SQL command will list all user/group rights defined for all site collection of web application -- Query to get all the users assigned to roles 


SELECT DISTINCT
CASE WHEN PATINDEX('%\%', FullUrl) > 0 THEN LEFT(FullUrl, PATINDEX('%\%', FullUrl) -1) ELSE FullUrl END AS [Site],
Webs.Title,
Webs.FullUrl,
Perms.ScopeUrl,
UserInfo.tp_Login As Account,
CASE WHEN UserInfo.tp_DomainGroup>THEN NULL ELSE UserInfo.tp_Title END ASUsername,
CASE WHEN UserInfo.tp_DomainGroup>THEN UserInfo.tp_Login ELSE NULL END AS [ADGroup],
NULL AS [SharePoint Group],
Roles.Title AS RoleTitle,
Roles.PermMask
FROM
dbo.RoleAssignment
INNER JOIN dbo.UserInfo ON RoleAssignment.SiteId = UserInfo.tp_SiteID AND UserInfo.tp_ID= RoleAssignment.PrincipalId
INNER JOIN dbo.Perms ON Perms.SiteId = RoleAssignment.SiteId AND Perms.ScopeId =RoleAssignment.ScopeId
INNER JOIN dbo.Roles ON RoleAssignment.SiteId = Roles.SiteId AND RoleAssignment.RoleId= Roles.RoleId
INNER JOIN dbo.Webs ON Roles.SiteId = Webs.SiteId AND Roles.WebId = Webs.Id
WHERE
Roles.Type<>AND tp_Deleted=0
UNION -- Query to get all the SharePoint groups assigned to roles
SELECT DISTINCT
CASE WHEN PATINDEX('%\%', FullUrl) > 0 THEN LEFT(FullUrl, PATINDEX('%\%', FullUrl) -1) ELSE FullUrl END AS [Site],
Webs.Title,
Webs.FullUrl,
Perms.ScopeUrl,
UserInfo.tp_Login As Account,
CASE WHEN UserInfo.tp_DomainGroup>THEN NULL ELSE UserInfo.tp_Title END ASUsername,
CASE WHEN UserInfo.tp_DomainGroup>THEN UserInfo.tp_Login ELSE NULL END AS [ADGroup],
Groups.Title AS [SharePoint Group],
Roles.Title AS RoleTitle,
Roles.PermMask
FROM
dbo.RoleAssignment
INNER JOIN dbo.Roles ON RoleAssignment.SiteId = Roles.SiteId AND RoleAssignment.RoleId= Roles.RoleId
INNER JOIN dbo.Perms ON Perms.SiteId = RoleAssignment.SiteId AND Perms.ScopeId =RoleAssignment.ScopeId
INNER JOIN dbo.Webs ON Roles.SiteId = Webs.SiteId AND Roles.WebId = Webs.Id
INNER JOIN dbo.Groups ON RoleAssignment.SiteId = Groups.SiteId AND RoleAssignment.PrincipalId = Groups.ID
INNER JOIN dbo.GroupMembership ON GroupMembership.SiteId = Groups.SiteId AND GroupMembership.GroupId = Groups.ID
INNER JOIN dbo.UserInfo ON GroupMembership.SiteId = UserInfo.tp_SiteID AND GroupMembership.MemberId = UserInfo.tp_ID
WHERE
Roles.Type<>AND tp_Deleted=0

Audit Permission changes in a Site Collection


By default security changes are not audited. To enable auditing in SharePoint 2007:
  1. Select Site Actions + Site Settings + Modify All Site Settings at the site collection root site.
  2. Click the Site collection audit settings link.
  3. Select the Editing users and permissions option:
Audit1
Once turned on, changes to permissions on sites, lists and items will be audited. To view the audit log:
  1. Click the Audit log reports link on the “Site Settings” page for the site collection.
  2. Click the Security Settings link:
Audit2
This will open the audit log in an Excel spreadsheet. The following example shows a summary showing a single security change resulting from a breaking of permission inheritance:
Audit3
____________________________________________________________________________________________________
By default security changes are not audited. To enable auditing in SharePoint 2010:
  1. Select Site Actions + Site Settings at the site collection root site.
  2. Click the Site collection audit settings link under Site Collection Administration.
  3. Select the Editing users and permissions option:

Once turned on, changes to permissions on sites, lists and items will be audited. To view the audit log:
  1. Click the Audit log reports link on the “Site Settings” page for the site collection.
  2. Click the Security Settings link:
     3. Select the File Save Location to save the Excel sheet.


This will open the audit log in an Excel spreadsheet. The following example shows a summary showing a single security change resulting from a breaking of permission inheritance:

Friday, October 2, 2015

SharePoint 2013 Installation


Issue 1:
During Installing SharePoint 2013 Prerequisites there was an error in installing Application Server Role , Web Server (IIS) Role : Configuration error

Steps to fix (Installing .Net Framework 3.5):
  1. Insert the Windows Server 2012 installation image or DVD
  2. Open a command prompt window (run as Administrator) and run the following:
  3. Dism /online /enable-feature /featurename:NetFX3 /All /Source:D:\sources\SxS /LimitAccess
Note: D:\ is a Label for CD Drive in my case where Windows Server 2012 ISO image.

Make a copy of ServerManager.exe and rename to ServerManagerCMD.exe - leave the copy in System32 folder.

or

rename the file C:\windows\System32\ServerManager.exe with ServerManagerCMD.exe 
and low and behold - it now works 

Monday, September 28, 2015

Website Restore Error

Recently, I was trying to browse a website with IE 10, which also uses Java. Noticed the "Website Restore error" (as shown below).


When i tried to browse the same site with IE 10 (No Add-ons) [You will see the IE 10 (No Add-ons) under Accessories >> System Tools], it was fine but saw a warning message.

The browser's Java plugin is not enabled. This Site uses java for certain file operations.

Worked on to identify the add-on which causes the "Website Restore error".
Finally found that the new Java add-on was causing the issue.


Disabled the 'Java Plug-in 11.51.2' and browsed the web site. Now it is working fine.

Monday, September 21, 2015

How to get latest InfoPath Template

Many SharePoint Developers work on InfoPath templates and publish from their computer/laptop. While they leave the company,if we forget to get the copies, it will be difficult to make further modifications.

We found a way to extract the latest template from the Form Library.

Go to the Form Library Settings >> Advanced Settings, you will see the URL of the Template. You can click on Edit Template and continue modifying.


Otherwise, you can save the Template to your desktop and start working on it.
Add the Template URL to the site URL to save the Template to your Desktop.

http://spdev.com/test/InfopathLibrary/Forms/template.xsn


You can also use SharePoint Designer to get the latest template.

Open Site in SharePoint Designer. Go to Form Library >> Forms Folder. You will find the template.xsn. Get a copy and use it to update new modifications.

Monday, July 20, 2015

SharePoint Search functionality

Sometimes, SharePoint Search functionality doesn't work due to issues like error in Propagation Status in Search Administration such as query Server not responding.

Click  on the below link for solution.
http://venugopalareddy.blogspot.com/2014/10/query-server-is-not-responding-and.html


Also we need to clear the config cache on all servers.

This is a summary of the actions:

  • Stop the “SharePoint 2010 Timer” service.

  • There are loads of XML files that can be found in the folder "C:\ProgramData\Microsoft\SharePoint\Config\". Note there seems to  be folder(s) under Config which has a GUID. 

  • Do not delete the folder(s) with GUID
  • Delete all the XML files in the GUID folder. 
  • Do not delete 'cache.ini' file.



  • Edit the "cache.ini" file, setting the content to "1" (without the double-quotes). This indicates that all cache settings need to be refreshed. Eventually this value gets automatically updated to another number when the cache is repopulated.
  • Start the “SharePoint 2010 Timer” service.
We need to perform the above steps on Index, Search, WFE(s) and App(s) servers in order.

Based on your SharePoint Usage, it is better to do this activity every 6 months.

For SP 2010 and 2013 >> https://spcachecleaner.codeplex.com/

List of All DBs in MOSS 2007

Tried to find list of DB’s used by SharePoint. We used to go searching the Central Admin - Application Management - Content Databases option and note all the databases against the URLs.

1. Found an awesome option, navigating to Central Admin >> Operations >> Perform a Backup




2. You can also run the following script on "SharePoint_Config" and get the list. Change the DatabaseInstance and DatabaseServer in the below script with your details.

SELECT o.[Name] AS 'SharePoint_Config',
    Instance.[Name] AS 'DatabaseInstance',
    [Server].[Name] AS 'DatabaseServer'
FROM Objects AS o
    INNER JOIN classes c on c.id = o.classid     
    LEFT JOIN Objects AS Instance ON o.ParentId = Instance.Id
    LEFT JOIN [Objects] AS [Server] ON Instance.ParentId = [Server].Id
    WHERE c.Fullname LIKE '%Administration.SPConfigurationDatabase%'
    OR c.Fullname LIKE '%Administration.SPContentDatabase%'
    OR c.Fullname LIKE '%Administration.SharedDatabase%'
    OR c.Fullname LIKE '%Administration.SearchSharedDatabase%'
    OR c.Fullname LIKE '%Administration.SPSearchDatabase%'


Wednesday, July 8, 2015

No Web Part Zones in SP 2010

We actually don't see Web part Zones in SharePoint 2010. 
We can add the web parts and changing the Layout of the Page.

Edit the Home Page, change the Layout with "Text Layout".


Keep the cursor in the Layout you need and click on 'Insert' tab.



Click on "Web Part" to see and add the Web Parts.

Wednesday, June 10, 2015

How to display RSS feed using XML Web Part


A good solution to display RSS Feeds using XML Web part, so there was no need for some third-party Web Parts. Also there was no need to write any additional code.
Easy step-by-step guide. 
  1. Go to page you need to add the RSS Feed, Open this page in edit view and add new Web Part called XML Web Part. 
     
  2. If Web Part is added to page then open it’s settings window. 
     
  3. On the field XML Link insert your blog feed URL. Check out if link is correct and content is receivable by clicking the link titled as Test Link. 
     
  4. Push button titled as [XSL Editor]. 
     
  5. XSL editing window is opened and now insert XSL code given below. When inserted click [OK]. 
     
  6. You should see the RSS feed as bulleted list. 
     
  7. Save the edited page.
XSL you need is here. Take it using copy and paste.

With the below code, you will get limited items 5 with Published Date in Green color.
<?xml version="1.0" encoding="UTF-8"?>

<xsl:stylesheet version="1.0" 
 xmlns:xsl="http://www.w3.org/1999/XSL/Transform" exclude-result-prefixes="xsl"> 
<xsl:output method="xml" omit-xml-declaration="yes" indent="yes"/>
<!--venugopalreddy.india@gmail.com-->

<xsl:template match="/"> 
<div><xsl:apply-templates select="rss/channel"/></div> 
</xsl:template> <xsl:template match="rss/channel"> 
<xsl:variable name="link" select="link"/> 
<xsl:variable name="description" select="description"/> 
<xsl:variable name="pubDate" select="pubDate"/> 

<ul> 
<!--<xsl:apply-templates select="item"/>--><!--For All Items--> 
<xsl:apply-templates select="item[position() &lt;= 5]"/><!--Limit 5 Items--> 
<xsl:apply-templates select="pubDate"/><!-- Published Date of the Items--> 
</ul>
</xsl:template> 

<xsl:template match="item"> 
<xsl:variable name="item_link" select="link"/> 
<xsl:variable name="item_title" select="description"/> 
<xsl:variable name="item_pubDate" select="pubDate"/>

<li> 
<a href="{$item_link}" title="{$item_title}" target="_blank"> 
<b><xsl:value-of select="title"/>&#160;</b> 
<!-- <font color="green"><xsl:value-of select="pubDate"/></font>--><!-- Date and Time --> 
<font color="green"><xsl:value-of select="substring(pubDate,1,16)"/></font> <!-- Date Only --> 
</a>
</li>
<li></li>
</xsl:template> </xsl:stylesheet>