December 19, 2011

Refinement Panel - Property doesn't exist

http://www.glynblogs.com/2011/01/create-a-content-type-search-refinement-panel-in-sharepoint-2010.html

1. New Managed Property --> Map
2. "Select Add Managed Property to Custom Set results set retrieved"
3. Full Crawl
4. Refinement Panel on Search --> Add Category with the Mapped Property Name.
<Category    Title=”My Managed Property”   Description=”Allows refinement by My Managed Property” Type=”Microsoft.Office.Server.Search.WebControls.ManagedPropertyFilterGenerator”    MetadataThreshold=”5″    NumberOfFiltersToDisplay=”4″    MaxNumberOfFilters=”20″     ShowMoreLink=”True”    MappedProperty=”MyManagedProperty”    MoreLinkText=”show more”    LessLinkText=”show fewer”    />
Note: Type: This has to be the TaxonomyFilterGenerator for Managed Metadata fields (for other fields you use the ManagedPropertyFilterGenerator class)
5. Search Core Results --> Uncheck the Location Visualization --> Add Column in Fetched Properties
6. Full Crawl and Done.

Note: Managed property there is an property called ‘Retrievable’ that allows whether the property can be used in queries. Turns out that the Content Type managed property is set to false, and try as I might you can’t change that (unless someone knows a way?)
http://www.sharepointanalysthq.com/2011/01/refining-on-content-type-in-sharepoint-2010/

Search in a document library points to Dispform.aspx instead of the file itself

December 14, 2011

ddwrt Redirect SharePoint Custom Forms

ddwrt Redirect


<input type="button" value="Save" name="btnSave" onclick="javascript:{ddwrt:GenFireServerEvent('__commit;__redirect={}')}"></input>

To Pass through variables:


<input type="button" value="Submit" name="btnSave" onclick="javascript: {ddwrt:GenFireServerEvent(concat('__commit;__redirect={/Pages/YourPage.aspx?ID=',/dsQueryResponse/Rows/Row/@ID,'}'))}" />


http://www.sharepointings.com/custom-list-forms/


Absolute and Relative Paths:

http://webdesign.about.com/od/beginningtutorials/a/aa040502a.htm

Ex: ../../SitePages/FAQs.aspx

December 07, 2011

This User Profile Application's connection is currently not available



1. Try to start the services before you start create the Service Applications.


This User Profile Application's connection is currently not available. The Application Pool or User Profile Service may not have been started. Please contact your administrator.
Resolution:
1. Application Pool  must have stopped, Restart it.
2. Try changing the Application pool Account in Inetmgr and change back to LocalService.
3. Check the Service if it started or not.


SQL Server Error while opening the Synchronization connections?
Resolution:
1. Configure Service Accounts and modify for the User Profile Service to a account which has access.


Useful:


https://www.nothingbutsharepoint.com/sites/devwiki/SP2010Admin/Pages/15%20-%20Configure%20User%20Profile%20Synchronization%20Service.aspx

Other Steps:
1. Restart the Application Pool (Sometimes WebRoot Pool gets stopped, restart it)
2. IISReset
3. Stop Start User Profile Service.
Note: UserProfSvc is just used in Connection String, evenywhere else, we use farmsvc

The managed Metadata Service or Connection is currently not available.

The managed Metadata Service or Connection is currently not available. The Application Pool or Managed Metadata Web Service may not have been started. Please Contact your Administrator.
Resolution:
1. Application Pool must have stopped, Restart It.
2. Check the Permissions for the Service and make sure it is already started too.

Sharepoint 2010 Install - Service Pack Install - SharePoint Products Config Errors

Service Accounts:

1. AdminSvcAccount - To Install the SP 2010 and any other Cumulative/Security Updates.
2. FarmSvcAccount - To run the SharePoint Configuration Wizard and The Database Setup Account.
3. UserProfSvcAccount - User Profile Service Account
4. ApplPoolSvcAccount - Application Pool Account
5. SearchSvcAccount - Search Service Account [Full Read Permission]
6. ContentSvcAccount - SharePoint Foundation Search

http://technet.microsoft.com/en-us/library/cc262243.aspx
ImportantImportant:
The server farm account is used to create and access your configuration database. It also acts as the application pool identity account for the SharePoint Central Administration application pool, and it is the account under which the Microsoft SharePoint Foundation Workflow Timer service runs. The SharePoint Products Configuration Wizard adds this account to the SQL Server Login accounts, the SQL Server dbcreator server role, and the SQL Serversecurityadmin server role. The user account that you specify as the service account must be a domain user account, but it does not need to be a member of any specific security group on your front-end Web servers or your database servers. We recommend that you follow the principle of least privilege and specify a user account that is not a member of the Administrators group on your front-end Web servers or your database servers.


1. SVC_SQL SQL Server Service Account Domain user account. 
   Identity of the MSSQLSERVER and SQLSERVERAGENT services on DB Server
2. SP_Admin Setup user account. 
    Used to perform installs and apply updates Domain user account.
    Should be a member of the local Administrators group on SP Server. 
    Should have securityadmin and dbcreator roles on the SQL server on DB Server. 
3. SP_Farm Database access account (aka Farm Admin Account). Domain user account. 
    Should be a member of     the local Administrators group on SP Server and DB Server. 
4.  SP_Search Search service account Domain user account. 
5.  SP_Content Search content access account Domain user account. 
6.   SP_App_Pool Used for application pool identity for the web application. Domain user account. 
7.   SP_User_Profile User Profile service account. 
      Used for user profile synchronization with AD. Domain user account.
     Requires "Replicating Directory Changes" permission on the domain in Active Directory.
8. Any other ports needed should be opened for any reporting services.



Username
Purpose
Description
SVC_SQL
SQL Server Service Account
Domain user account. Identity of the MSSQLSERVER and SQLSERVERAGENT services on SQLSERVER Box
SP_Admin
Setup user account. Used to perform installs and apply updates
Domain user account. Should be a member of the local Administrators group on SP Box. Should have securityadmin and dbcreator roles on the SQL Server of SQL Box.
SP_Farm
Database access account (aka Farm Admin Account).
Domain user account. Should be a member of the local Administrators group on SP Box and SQL Box.
SP_Search
Search service account
Domain user account.
SP_Content
Search content access account
Domain user account.
SP_App_Pool
Used for application pool identity for the web application.
Domain user account.
SP_User_Profile
User Profile service account. Used for user profile synchronization with AD.
Domain user account. Requires “Replicating Directory Changes” permission on the domain in Active Directory.

More Info @ 9.3 Creating several service accounts - about least priviliege administration policy
of  
http://mosshowto.blogspot.com/2009/11/installing-sharepoint-2010-windows-2008.html
SharePoint 2010 Install Guide:

http://mosshowto.blogspot.com/2009/11/installing-sharepoint-2010-windows-2008.html

Failed to Create Configuration Database - SQLServer, Port
Few Companies don't open default 1433 SQL Server port for Security Reasons and hence we need to configure the port in ODBC at C:\Windows\SysWOW64\odbca32 and configure to the port they give us.
http://globalitlinks.blogspot.com/2011/08/failed-to-create-configuration-database.html

Active Directory
http://alipka.wordpress.com/2010/05/13/the-given-key-was-not-present-in-the-dictionary-issue-in-sharepoint-2010-rtm/

http://wellytonian.com/2011/07/sharepoint-2010-service-pack-1-installation-steps/

Error while configuring SharePoint Configuration Wizard:

 An exception of type System.MissingMethodException was thrown. Additional exception information: Method not found: 'System.String Microsoft.SharePoint.Administration.SPSqlConnectionString.GetWYukonSafeConnectionString(System.String)'.

1. Go to Bin Folder and Run PSConfigUI as Administartor

Resources:
psconfig -cmd upgrade -inplace b2b –force
http://community.corasworks.net/blogs.aspx?CWFrameSource=http://community.corasworks.net/blogs/fromthefield/archive/2011/08/30/sharepoint-products-configuration-wizard-may-fail-after-installing-sharepoint-2010-sp1-or-cumulative-updates.aspx

http://technet.microsoft.com/en-us/sharepoint/ff800847

Steps:
1. SharePoint 2010 Foundation SP1
2. SharePoint Server 2010 SP1
3. SharePoint Server CU
4. Run Wizard as Admin
5. Start User Profile Synchronization Service

Update 1:

An exception of type Microsoft.SharePoint.PostSetupConfiguration.PostSetupConfigurationTaskException was thrown. 
Additional exception information: An error has occurred while validating the configuration settings. 
Resolution: Add all the service accounts in Administrator Group and Run the PSConfig via powershell in the Central Admin Server and Just run the Wizard in the other servers.



Custom Errors and Call Stack

OWSTimer.exe crashing

Hide Signin for Anonymous Site

December 05, 2011

BDC -- Application Definition Designer

Turn User Account Control on or off

Search in SharePoint 2010

Trust certificates between farms (SharePoint Server 2010)

All Steps :
http://technet.microsoft.com/en-us/library/ff621100.aspx

Unable to connect to a shared service application:

http://social.technet.microsoft.com/Forums/is/sharepoint2010setup/thread/0f2e4574-dc20-4b86-a398-50b058b19e88

Very Nice :
http://blogs.msdn.com/b/mcsnoiwb/archive/2010/02/05/how-to-publish-a-managed-metadata-service-for-cross-farm-consumption.aspx

Diagrams:
http://www.bfcnetworks.com/connecting-sharepoint-2010-farms-with-service-applications-part-2/

1. Exchange Certificates
2. Publish Service Application and Give Read Access to the Service for All Authenticated Users.
3. Consuming farm permission to the Application Discovery and Load Balancing Service Application on the publishing farm.
4. Connect
5. Application Management --> Manage Associate Service Applications if there are more than one content type hub kind of things.


Snapin for Windows Powershell: Add-PSSnapin Microsoft.SharePoint.Powershell

December 02, 2011

Error occurred in deployment step ‘Activate Features’: The ContentType with id defined in feature

Sandbox Deployments

Access Denied for Configure Service Accounts Link

MOSS Service Accounts

November 30, 2011

STSADM Custom Commands

http://blog.falchionconsulting.com/index.php/downloads/

Example: http://blog.falchionconsulting.com/index.php/2008/02/export-content-types/

SET SOLUTION_NAME=”Lapointe.SharePoint.STSADM.Commands.wsp”
SET STSADM=”C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\bin\stsadm”
%STSADM% -o addsolution -filename %SOLUTION_NAME%
%STSADM% -o deploysolution -local -allowgacdeployment -name %SOLUTION_NAME%


Deploying the exported Content Types:
http://www.sharepointnutsandbolts.com/2007/04/deploying-content-types-as-feature.html

User Profile Service - File Not Found

Farm Account Issue, Sometimes Sharepoint is installed with some account and is configured with some other account. Then Just go to Security --> Configure Service Accounts --> Update Farm Account

November 18, 2011

Linq



IEnumerable Way


var results = SPContext.Current.Web.Lists["Some List"].Items.Cast().Where(item => item[SPBuiltInFieldId.Title].ToString() == "Title To Search");


foreach(SPListItem item in results)
{
//logic
}


Ling Way


List results = (from SPListItem item in listobject where item["Title"].ToString() == "blahblah" select item).ToList();


foreach(SPListItem item in results)
{
//logic
}

Send email to all users of a sharepoint group

November 11, 2011

Single Breadcrumb - SharePoint 2010

Powershell SPSiteDataQuery Debug




clear
$site = Get-SPSite -Identity http://url
$q = New-Object -TypeName microsoft.SharePoint.SPSiteDataQuery
$q.Lists = "<Lists BaseType='1'/>"
$q.ViewFields = "<FieldRef Name='FieldInternalName'/>"
$q.Query = "<Where><Eq><FieldRef Name='FieldInternalName'/><Value Type='Text'>2011-0077</Value></Eq></Where>"
$q.Webs = "<Webs Scope='SiteCollection'/>"
echo $site.RootWeb.GetSiteData($q).Rows.Count

November 10, 2011

SharePoint 2010 Loopback

http://support.microsoft.com/kb/896861

Method #1 BackConnectionHostNames
  1. Click Start, click Run, type regedit, and then click OK.
  2. In Registry Editor, locate and then click the following registry key:

    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\MSV1_0
  3. Right-click MSV1_0, point to New, and then click Multi-String Value.
  4. Type BackConnectionHostNames, and then press ENTER.
  5. Right-click BackConnectionHostNames, and then click Modify.
  6. In the Value data box, type the host name or the host names for the sites that are on the local computer, and then click OK.
  7. Quit Registry Editor, and then restart the IISAdmin service

Method 2: Disable the loopback check (less-recommended method)

The second method is to disable the loopback check by setting the DisableLoopbackCheck registry key.

To set the DisableLoopbackCheck registry key, follow these steps:
  1. Set the
    DisableStrictNameChecking
    registry entry to 1. For more information about how to do this, click the following article number to view the article in the Microsoft Knowledge Base:
    281308  Connecting to SMB share on a Windows 2000-based computer or a Windows Server 2003-based computer may not work with an alias name
  2. Click Start, click Run, type regedit, and then click OK.
  3. In Registry Editor, locate and then click the following registry key:
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa
  4. Right-click Lsa, point to New, and then click DWORD Value.
  5. Type DisableLoopbackCheck, and then press ENTER.
  6. Right-click DisableLoopbackCheck, and then click Modify.
  7. In the Value data box, type 1, and then click OK.
  8. Quit Registry Editor, and then restart your computer.
Also, make sure you have entry in AAM and Host file.

October 28, 2011

Failed to create receiver object from assembly

http://social.technet.microsoft.com/Forums/en/sharepoint2010setup/thread/55217486-0df5-43ca-9487-cdb7a66334c9

The problem was because the timer service cached the previous dlls. You have to restart timer service on all servers in the farm before starting any new deployment.


Sometimes: Just close the VS and re-open the project again if deploying thru VS.

October 16, 2011

Access web.config in SharePoint timer job


SharePoint web application or site will run with the help of process 'W3WP.EXE'.
SharePoint timer job is running in different process named 'OWSTIMER.EXE'.
So, the application configuration file is associated with the W3WP.EXE, so there is no way to access the web.config file in the owstimer.exe process at all. The context is completely different and out of domain. So, we need to call or access the web.config file explicitly in timer job.

So add below code in Execute() method to access ConnectionString in Timer JOB.


SPWebApplication webApplication = this.Parent as SPWebApplication;
Configuration config = WebConfigurationManager.OpenWebConfiguration("/", webApplication.Name);
_ConnString = config.ConnectionStrings.ConnectionStrings["ConnectionName"].ConnectionString.ToString();



Restart Timer Service in SharePoint

SharePoint 2010: net stop SPTimerV4 / net start SPTimerV4


SharePoint 2007: net stop SPTimerV3 / net start SPTimerV3
SharePoint 2003: net stop SPTimer / net start SPTimer
Note: When you publish/update a custom timer job, it usually doesn't reflect right away until we restart the timer service.

SonarQube with Jenkins Setup using Docker Images

https://funnelgarden.com/sonarqube-jenkins-docker/  https://medium.com/@hakdogan/an-end-to-end-tutorial-to-continuous-integration-and-con...