Wed 19 Feb 2014

I have came through below wiki article on Microsoft technet, which have a nice collection of eBooks and articles on Microsoft Technologies.

Download content for SharePoint, Lync, MS Office, SQL Server, System Center, Visual Studio, Web Development (asp.net), Windows Server, Window Azure, Windows Phone and other Microsoft technologies in e-book formats (references, guide, and step-by-step).

 

E-Book Gallery for Microsoft Technologies

 

Source: social.technet.microsoft.com/wiki/contents/articles/11608.e-book-gallery-for-microsoft-technologies.aspx (Monica Rush)
Source: mstechtalk.com/collection-of-e-book-and-articles-on-microsoft-technologies/ (Adnan Amin)

 

Comments here
Tue 26 Mar 2013

In last days, I was trying to restore SharePoint web application backup using PowerShell, but run into following error (although my sharepoint version was newer then the backup version)

Restore-SPSite : Your backup is from a different version of Microsoft SharePoint Foundation and cannot be restored to a server running the current version. The backup file should be restored to a server with version '14.0.0.5138' or later.

Following is the quick overview / steps which I followed and successfully restored the SharePoint backup. Might be this could be applicable in your case

If you have the source database files (mdf and ldf) not the SharePoint backup file then follow step 2, otherwise step 1 and 2

Step 1.

  • Create a virtual machine if you don’t have

  • Install SharePoint on that vm if your don’t have it on that vm

  • Make the environment version same by installing the same cumulative update(s) which source server has. Once the server has the same version as of the backup, in my case it was (14.0.0.5138). (to check SharePoint version central administration -> upgrade and migration -> check product and patch installation)

  • Create new web application and Restore the SharePoint backup.

  • In sql server, detach the restored SharePoint database and physically copy database files (mdf and ldf)

 

Step 2.

On SharePoint environment where you want to restore the backup (this SharePoint version obviously needs to be later version, in my case it was 14.0.6029.1000)

  • Create web application (no need to create site collection) (central administration -> application management -> manage web application-> new)

  • Remove content database of newly created web application (central administration -> application management -> manage content database -> choose web application from the dropdown -> click on database name -> choose offline from database status and check mark Remove content database) (make sure you have selected the newly created web application and its content database)

  • In sql server, detach that content database of newly created web application

  • Physically replace the detached content database files (mdf and ldf) from the SharePoint backup's mdf/ldf file (which were taken from step1 or from the original server / source)

  • Attach Database (while attaching, after selecting mdf file, Change the Database name as of file name in Database to Attach's -> Attach As textbox, then on same screen, select/browse both mdf and ldf file in database details section -> Current File Path)

  • Open SharePoint 2010 Management Shell, and add content database using following command
    stsadm -o addcontentdb -url <URL name> -databasename <database name>

  • Then follow remaining application specific restore steps (for e.g. change site collection administrators, changes in web.config, add or change global resource files etc.)

Then access web application, hope so it would restored successfully

 

Comments (2)
Wed 25 Apr 2012

In sharepoint, if it is required to disable the filter and to keep only the sorting, then following workaround could be the solution one.
(Following change are done to sharepoint 2010 using sharepoint designer 2010, might be it works for 2007 aswell)

Please keep the copy of file(s) which you are going to change, incase if some mishap happen J

·         Open the desired sharepoint site in sharepoint designer

·         Select Lists and Libraries from the Site Objects

·         Select desired list / library

·         Select the desired view from the views list where you want to remove to remove filter

·         Click on advance mode

·         Search for the <ViewFields> inside <XmlDefinition>

·         Now add following desired attribute to all desired columns. (All column are  <FieldRef Name="ModifiedOn" />)

as

 <FieldRef Name=" ModifiedOn " LinkToItem="TRUE" Filterable="FALSE" FilterDisableMessage="No filter available "/>

After that, edit the page where the list / library webpart exists or add webpart (list / library) if not already added on the page,  edit webpart properties and select the desired view again then click apply button to reflect changes.

 

In above,

·         You can change the default text for disabled filter using FilterDisableMessage="No filter available " attribute

·         By adding Filterable="FALSE", now the filter will not be available

·         If you want to make a particular column clickable, then add LinkToItem="TRUE"

 

Comments (4)
Wed 26 Jan 2011

Get-SPSite | where {$_.url -like "http://a *"}

Get-SPFarm | Format-List Id, BuildVersion, Servers, Solutions

Add-PSSnapin Microsoft.SharePoint.Powershell

===========

ExecuteHelloWorldScript from batchfile

powershell -Command "& {.\Hello.ps1}" -NoExit
pause


powershell -Command "& {Set-ExecutionPolicy bypass}" -NoExit


===========

CreateContosoSite

if($args) {
  $SiteName = $args[0]
  $SiteUrl = "http://a:3811/sites/ " + $SiteName
  Write-Host "Begin creating Contoso site at" $SiteUrl
  Write-Host
  $NewSite = New-SPSite -URL $SiteUrl -OwnerAlias Administrator -Template STS#1 -Name $SiteName
  $RootWeb = $NewSite.RootWeb
  $RootWeb.Title = "Contoso Site: " + $SiteName
  $RootWeb.Update()
  Write-Host "New Contoso site successfully created"
  Write-Host "-------------------------------------"
  Write-Host "Title:" $RootWeb.Title -foregroundcolor Yellow
  Write-Host "URL:" $RootWeb.Url -foregroundcolor Yellow
  Write-Host "ID:" $RootWeb.Id.ToString() -foregroundcolor Yellow
}
Else {
  Write-Host "ERROR: You must supply Name as parameter when calling CreateContosoSite.ps1"
}


===========

GetSharePointDlls

$path = "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14"

Get-ChildItem $path -recurse |
  Where-Object {$_.name -like "*SharePoint*.dll"} |
  Sort-Object -Property Name -unique |
  Format-Table Name


===========


GetSharePointPublishingFeatures

Get-SPFeature -Limit ALL |
  Where-Object {$_.DisplayName -like "*Publishing*"} |
  Sort-Object -Property Scope
  Format-Table DisplayName, Id, Scope

 

===========

.\GetSharePointPublishingFeatures.ps1
Get-SPFarm | Format-List
Get-SPSite | where {$_.url -like "http://a *"}
.\CreateContosoSite.ps1 lab01test


===========

Comments here
Fri 12 Feb 2010

SPWeb has two sharepoint cross-site group collection, SPWeb.Groups and SPWeb.SiteGroups.

SPWeb.Groups returns collection of cross-site groups which has some permission on the site. So if you add group from a site without any permission on the site, then this group wont appear in SPWeb.Groups collection, but it will appear in SPWeb.SiteGroups collection.

You can not use SPWeb.Groups.Add method to add new cross-site group, you need to use SPWeb.SiteGroup.Add method for this purpose.

In addition to this SPWeb has a property AssociatedOwnerGroup, which will return the required SPGroup. You can iterate the SPGroup users to get the list of all owners of the site.

 foreach (SPUser user in web.AssociatedOwnerGroup.Users)
 {
      // .. list all the users                        
 }

 

Finding and adding group

SPGroup  group = GetSiteGroup(web, "groupName");
if (null == group)
{
 web.SiteGroups.Add("groupName", web.AssociatedOwnerGroup, null, "Test Group description");
}

 


private static SPGroup GetSiteGroup(SPWeb web, string name)
{
    foreach (SPGroup group in web.SiteGroups)
    {
 if (group.Name.ToLower() == name.ToLower())
 {
     return group;
 }
    }
 return null;
}

 

 

Tags: , ,
Comments here
Thu 28 Jan 2010

Few days before, I was having problem that after clicking on Export to pdf button / image, other controls of web part/user control stops working on the application page on WSS 3.0 environemnt that has RadGrid on it.

While the same thing was working on other asp.net application outside the sharepoint environment.

1st workaround (can be a solution)

The cause for this behavior is that there is a flag (named _spFormOnSubmitCalled) in SharePoint which prevents double form submition. This flag is set when the form is submitted and clear when the response is received.
However when exporting the response is redirected and the page is not updated, thus the flag is not cleared and page's postbacks are blocked.

In order to workaround this behavior you should manually clear the flag when exporting. This can be achieve, for example in export button's client click function similar to the following:

MyExportButton.OnClientClick = "_spFormOnSubmitCalled = false;"  

Above workaround will allow you to export multiple times, but all the other controls on the page were still not functional after the export.

2nd workaround (Not / Never recommended)

In your sharepoint master page, remove onsubmit attribute from your form tag

<form runat="server" onsubmit="return _spFormOnSubmitWrapper();"> 

and remove the onsubmit attribute.  This is what it looks like now:

<form runat="server"> 

3rd workaround (so far so good and implementable)

Add the following script to your webpart / custom control that need to have export and other controls functionals, rather then implementing the above workarounds
So here you go with the working solution.

<script type="text/javascript" language="javascript">

    //sharepoint postback to work after clicking on telerik export to pdf
    if (typeof (_spBodyOnLoadFunctionNames) != 'undefined' && _spBodyOnLoadFunctionNames != null) {
        _spBodyOnLoadFunctionNames.push("supressSubmitWraper");
    }

    function supressSubmitWraper() {
        _spSuppressFormOnSubmitWrapper = true;
    }
   
</script>

 

Hope this will helps.

 

Comments (23)




Ads