Posts

Showing posts from December, 2011

Export SharePoint 2010 sites list to Excel File

Image
How to get the SharePoint 2010 sites list to Excel using  Powershell ? Go to  SharePoint 2010 Management Shell . You have to open the Web Application, then the Site Collection, after Select the Fields and Export to Excel (csv file) $Get-SPSite | Get-SPWeb | Select url,title | Export-Csv All this on one line in PowerShell, just think how much time it saves time instead of building a console application. Yours Roi

Sharepoint 2007 Crawl Never Ends - Always Status Crawling

Image
I had "Not Stopped the Search Index Crawler " case in SharePoint 2007 (in “ Crawling ” status indefinitely) and doesn't respond to stop requests I had not stopped the search case " Stop Crawl " But nothing - stuck " Stopping " The solution:  Enter the following stsadm commands : execadmsvcjobs , osearch -action stop, -o osearch -action start -role Index C:\>stsadm -o  execadmsvcjobs Executing . Operation completed successfully. C:\ >stsadm -o osearch -action stop The Office SharePoint Server Search service was successfully stopped. C:\>stsadm -o osearch -action start -role Index The Office SharePoint Server Search service was successfully started. Now you need to do - Reset all craweld content Now re-run the indexing, this should solve the problem. Hope I helped, Roi

SPListItem​Collection to Linq List

Image
This time you code gives us extension to  SPListItemCollection object. SPListItem​Collection to Linq List If you want to work with the object of SPListItemCollection using linq - The following code can help public   static   List < SPListItem > ToList( this   SPListItemCollection  items) {      IEnumerable < SPListItem > itemsContiens = items.OfType< SPListItem >();      return  itemsContiens.ToList< SPListItem >(); } Yours... Roi

The underlying connection was closed: An unexpected error occurred on a receive

Image
When I tried to access an external server on the server side (not the organization) through the code (in my case web-part of sharepoint) I got an error: The code is simple code: public   XmlDocument  GetXmlData() {      XmlDocument  document =  new   XmlDocument ();      //Now load the XML Document     document.Load( this .url); // fall      return  document; } The error I got it:    The underlying connection was closed: An unexpected error occurred on a receive.    Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.    at System.Net.HttpWebRequest.GetResponse()    at System.Xml.XmlDownloadManager.GetNonFileStream(Uri uri, ICredentials credentials)    at System.Xml.XmlDownloadManager.GetStream(Uri uri, ICredentials crede...

Update SharePoint fields on Client-Side with spservices

Image
This time I will present a client-side code (JavaScript) - which updates a list of fields without having to insert the data (edit) into the form. All you need is another class from beloved and familiar - jquery that Called- spservice :  http://spservices.codeplex.com/ It works in 2007 and 2010 because the code in the form ajax turns  to the sharepoint web-service. (Although in 2010 we have the " Client Object Model "). The following code built two objects - an image and textbox I make an update of the field after clicking on the image, and then I prevent users from updating again. Please note, I use the method of spservice SPUpdateMultipleListItems . The method get the following variables: webURL, listName, CAMLQuery, batchCmd, valuepairs, debug ...    < input   type ="text"   id ="txt <% = this.UniqueID %> "   class ="myClass1"   value =" <% = likeValue %> "   />    < img   ...