Resolving error of “is an unexpected token. The expected token is xx or xx . Line xx ,Position xx for Sharepoint 2007

This is a very generic error  fired by .net xml parsers System.Xml.XmlException. In our scenario this error has occured when we tried to change authentication providers for a site.

Usually this error is cuased by a missing charecter or illegal charecter usage in xml files. You know we have so many configuration file in sharepoint. Basic and first look place is that the Web.Config file. Notice that the line and position values and check your web.config file any problem on this location.

For our scenario the Problem Found on 23, 109 the double quots are not supported type for includesubfolders attribute

<PageParserPath VirtualPath=”/*” CompilationMode=”Always” AllowServerSideScript=”true” IncludeSubFolders=true />

So the error has fired once sharepoint try modification to web.config for update the authentication providers. So the error source is important to define which configuration file that you have to check.



MOSS2007 viewlsts.aspx reports that item count mismatch with document library item count.

This is very common misunderstanding of sharepoint libraries. Draft files can be counted as viewlsts.aspx reports. This meas documents count in document library can be different than actual count also item level security can provide this difference. But the real problem is even if System Admin or Site Administrator somehow can not able to see that documents in document library.

In our scenario we have 14 files that reported by viewlsts.aspx page , but when we login as system admin and browse the library the total file count which is same visible file count , is 13.And this problem is related with Sharepoint 2007 Sp1 which is currently not supported state. (So please upgrade your system as soon as possible to SP2) .So some of files should be check out to a user(s) . Ok than we checked the Document Library Settings->Manage Checked Out files and see nothing ? that’s wierd.

I am sure that the problem checkout to user so How could we find the users ? For troubleshooting issue we have to connect sharepoint db just for select. Don’t forget that  do not change anything in Sharepoint DB this kind of operations are not supported.

First We select all lists for finding Guid of the issued list.

select * from lists where  tp_Title  like ‘%Network Trainings%’
we noted the ListId Guid and SiteId guid from query results :

ListId: B08577CD-A418-4E08-8F6D-33365082FF05
SiteId: E39EF3B7-5679-45DE-8565-97D9C6F9CAB3

Than Getting all files for this list from AllDocs table:

select LeafName,DocLibRowId,[Type],Version,UIVersion,Dirty,IsCurrentVersion,[Level],DraftOwnerId from alldocs where listid=‘B08577CD-A418-4E08-8F6D-33365082FF05’

On results we compre the files for defining which file can not be able to seen by System Admin account:

“BGP  trainings.doc” ‘s DraftOwenerId is set to 960

The userid has changed by site collection so query userinfo table like this.

select * from userinfo where tp_SiteID=‘E39EF3B7-5679-45DE-8565-97D9C6F9CAB3’ and  tp_id=960
Resutls say : Domain****\a90003342 is draftowner

Now you can find the user account from results. we could not find the cause why the system admin account cant see the documents in “Manage Checked out files” also i don’t intend to find reason for unsupported version. We loged in with this user account and able to see all documents.So this is not a common scenario , i always suggest that use latest version of sharepoint sp and cu.

Unable to complete upgrate after installing Aug 2011 Cu for Sharepoint 2010 and getting error of Exception: localStoragePath

Every upgrade attemp is one of challage for IT team. So this time we are working on a problem which is occured after Aug 2011 Cumulative Update.
the symptom is Sharepoint Configuration Wizard can not able to complete and finishing with failure.

First of all once we check the PSCDiagnostics logs we could not able to find something useful:

Configuration of SharePoint Products failed.  Configuration must be performed in order for this product to operate properly.  To diagnose the problem, review the extended error information located at C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\LOGS\PSCDiagnostics_10_7_2011_9_55_26_860_989474110.log, fix the problem, and run this configuration wizard again

Cool but it say nothing. So we peek that let check “upgrade” logs …
And see some error. LocalStoragePath. What is actually LocalStoragePath and why we are getting this error while upgrading. It is definitly something wrong with search db.

[OWSTIMER] [SPUpgradeSession] [ERROR] [10/7/2011 10:05:49 AM]: Exception: localStoragePath
[OWSTIMER] [SPUpgradeSession] [INFO] [10/7/2011 10:05:49 AM]: SearchAdminDatabase Name=Fast_Query_SSA_DB_3a64d349dc2249679a8be
[OWSTIMER] [SPUpgradeSession] [ERROR] [10/7/2011 10:05:49 AM]:    at Microsoft.Office.Server.Search.Administration.SearchApi.AssertParameter(String parameterName, Boolean condition)
   at Microsoft.Office.Server.Search.Administration.SearchApi.UpdateAdminComponent(String serverName, Guid serverId, String localStoragePath, Boolean standalone, Nullable`1 settingsInRegistry)
   at Microsoft.Office.Server.Search.Upgrade.SearchAdminDatabaseSequence.InitializeTopologyBasedOn2007Settings()
   at Microsoft.Office.Server.Search.Upgrade.SearchAdminDatabaseSequence.PostUpgrade()
   at Microsoft.SharePoint.Upgrade.SPUpgradeSession.Upgrade(Object o, Boolean bRecurse)

The problem in our scenario is some how psconfig can not update the topology, possible cause for this may be service name changes may be an old conf. backup restored or even more the server name has changed.  


1. Checked the Upgrade error log and notice following information
[OWSTIMER] [SPUpgradeSession] [INFO] [10/7/2011 10:05:49 AM]: SearchAdminDatabase Name=Fast_Query_SSA_DB_3a64d349dc2249679a8be…

2.Use Get-SPEnterpriseSearchServiceApplication cmdlet and list all search service applications. we try to delete the Search Service Application. Unable to delete the service Application through GUI hence tried successfully with following Powershell command.

$ssa = Get-SPEnterpriseSearchServiceApplication -Identity 4e6d0c5c-f47b-425e-a637-e8a44aca12ae

We had 2 search application more so we deleted all of them .

3. Run the configuration wizard

4. created a new SSA to after configuration wizard has run.

Getting error of “Unable to display this Web Part” on WSS2.0/SPS2003 after installing MS11-074

September Security Bulletin (MS11-04) is affecting WSS 2.0/SPS2003 ,  After installing security update MS11-074 for Windows SharePoint Services 2.0 / SharePoint Portal Server 2003 (KB 2494007), we are faced with problems with some DataViewWebPart s.
The error message is :
Unable to display this Web Part. To troubleshoot the problem, open this Web page in a Windows SharePoint Services-compatible HTML editor such as FrontPage. If the problem persists, contact your Web server administrator.”

the problem is cause by The Security Update breaks some XSLT ddwrt functions in the Data View Web Part, for example, ddwrt:FormatDate(string szDate, long lcid, long formatFlag) and ddwrt:FilterLink().

For resolving this issue you ;

1) Upgrade to Windows SharePoint Services 3.0 or Office SharePoint Server 2007.
2. Evaluate how widely the Data View Web Part is used and apply the following workaround if there are very few pages affected:
Remove broken ddwrt functions in the Extensible Stylesheet Language Transformation (XSLT) code of the Data View Web Part.
Here is an example when the broken ddwrt function is
ddwrt:FormatDate(string szDate, long lcid, long formatFlag):

Replace code “ddwrt:FormatDate(string(@someDateField), 1033, 5)” with “@someDateField”. By applying this work around, the Data View will render in browser, however, the formatting of the Date field will be changed as following:

Before the security update, the date is in this format: 9/27/2011 6:21 PM
After above work around, the date is in this format: 2011-09-27T18:21:03

Another example, ddwrt:FilterLink(), this function returns an empty string. Just remove the function, the Data View should render the same way as before.

The above concept can be applied to other ddwrt functions with caution. There are possibilities that removing ddwrt functions will impair the function of XSLT so that the data displayed in Data View is not in the desired format. In those situations, please consider option 1 or 3.

3. Rollback the WSS 2.0/SPS 2003 farm to a state prior to installing the above Security Update. A backup of the farm/content databases before the security update is required for this to be successful.

Create all users’ personal site via Powershell script – Sharepoint 2010

#PowerShell Script - Create All Users Personel Sites - SharePoint 2010 #The scripts is distributet "as-is." Use it on your own risk. 
#Add SharePoint PowerShell SnapIn if not already added if ((Get-PSSnapin "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue) -eq $null) {
    Add-PSSnapin "Microsoft.SharePoint.PowerShell"


$mysiteHostUrl = "http://my"
$personalSiteGlobalAdmin = "DOMAIN\padm"
$personalSiteGlobalAdminNot =""
$personalSiteGlobalAdminDisplayName = "Personel Site admin"
$mysite = Get-SPSite $mysiteHostUrl

$context = [Microsoft.Office.Server.ServerContext]::GetContext($mysite)
$upm =  New-Object Microsoft.Office.Server.UserProfiles.UserProfileManager($context)

$AllProfiles = $upm.GetEnumerator()

foreach($profile in $AllProfiles)

    $DisplayName = $profile.DisplayName
    $AccountName = $profile[[Microsoft.Office.Server.UserProfiles.PropertyConstants]::AccountName].Value
       #Add your restrictions for users.        if($Accountname -like "YourDomain*")
          if($profile.PersonalSite -eq $Null)
               write-host "Creating personel site for ", $AccountName
               #Adding an extra admin for personel sites                $pweb = $profile.PersonalSite.OpenWeb()
               $padm= $pweb.AllUsers[$personalSiteGlobalAdmin];
               $padm.IsSiteAdmin = $true;
               write-host "Personal Site Admin has assigned"
               write-host $AccountName ," has already personel site"