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...