November 11, 2011
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
To set the DisableLoopbackCheck registry key, follow these steps:Also, make sure you have entry in AAM and Host file.
Method #1 BackConnectionHostNames
- Click Start, click Run, type regedit, and then click OK.
- In Registry Editor, locate and then click the following registry key:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\MSV1_0 - Right-click MSV1_0, point to New, and then click Multi-String Value.
- Type BackConnectionHostNames, and then press ENTER.
- Right-click BackConnectionHostNames, and then click Modify.
- 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.
- 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:
- Set theDisableStrictNameCheckingregistry 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
- Click Start, click Run, type regedit, and then click OK.
- In Registry Editor, locate and then click the following registry key:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa
- Right-click Lsa, point to New, and then click DWORD Value.
- Type DisableLoopbackCheck, and then press ENTER.
- Right-click DisableLoopbackCheck, and then click Modify.
- In the Value data box, type 1, and then click OK.
- Quit Registry Editor, and then restart your computer.
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.
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.
September 16, 2011
PowerShell
http://bable.cybermarshall.com/2009/05/27/ocring-all-of-the-pdf-files-in-a-sharepoint-document-library-using-powershell-and-solid-pdf-tools/
http://mukalian.com/blog/post/2011/04/10/PowerShell-Script-to-Delete-All-Versions-in-a-Document-Library.aspx
http://www.learningsharepoint.com/2010/08/19/check-in-documents-with-powershell-sharepoint-2010/
http://blog.pointbeyond.com/2011/08/24/finding-duplicate-documents-in-sharepoint-using-powershell/
http://mukalian.com/blog/post/2011/04/10/PowerShell-Script-to-Delete-All-Versions-in-a-Document-Library.aspx
http://www.learningsharepoint.com/2010/08/19/check-in-documents-with-powershell-sharepoint-2010/
http://blog.pointbeyond.com/2011/08/24/finding-duplicate-documents-in-sharepoint-using-powershell/
Subscribe to:
Posts (Atom)
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...
-
http://www.codeproject.com/KB/ajax/ExpandPanelGridView.aspx
-
http://sharepointmagazine.net/articles/creating-documents-with-sharepoint-designer-2010-workflows Issue#1 : The workflow could not cr...
-
I guess Drawing is my first extra curricular activity which i have developed during the school days. Thanks to Bhargavi Teacher[my Drawing T...