Wednesday 23 January 2013

How to set the database to read/write in SharePoint 2010


If you verify that the content database is in read-only mode, set the SQL Server Management Studio database to read/write.
To verify that the database is read-only:
  1. Verify that the user account that is performing this procedure is a member of the Farm Administrators group.
  2. On the Central Administration Home page, click Application Management.
  3. On the Application Management page, in the Databases section, click Manage content databases.
  4. On the Manage Content Databases page, select the Web application from the Web Application list.
  5. If Yes appears in the Database Read-Only column for the content database, set the content database to read/write.
To set the content database to read/write:
  1. Verify that the user account that is performing this procedure is a member of the db_owner fixed database role for the content database.
  2. Open SQL Server Management Studio and connect to the database server.
  3. In Object Explorer, expand Databases.
  4. Right-click the database that you want to set to read/write, and then click Properties.
  5. In the Database Properties dialog box, on the Options properties page, under State, select False from the drop-down list next toDatabase Read-Only, and then click OK.
  6. Click Yes.

Tuesday 22 January 2013

Configuring outgoing email in SharePoint 2010 with Exchange 2010


Launch the Exchange Management Console and navigate to Server Configuration / Hub Transport / New Receive Connector.  The New Receive Connector wizard is invoked.
Enter a descriptive name and ensure “Custom” is selected as the intended use.
Click Next
Leave “All Available IPv4” in your Local Network settings unless you have specific Exchange IP requirements.
Click Next
Edit the IP address of your SharePoint 2010 server.
Click Next
Click New
You will now notice that our SharePoint 2010 Outgoing mail connector is listed with our default Exchange 2010 Receive
Connectors..  

We will now venture into its properties and make a minor permission change.  Click on the “Permission Groups” tab and select Anonymous users.
Click Apply.
Configuring outgoing email in SharePoint 2010 Central Administration
Launch Central Administration and navigate to System Settings / E-Mail and Test Messages / Configure outgoing e-mail settings.
Enter your Outbound SMTP server, i.e. your Exchange server where we created our receive connector and specify a From and Reply-to address.
In outbound SMTP server text box write your exchange server address(servername.exchangedomainname.local , or IP address).
In my case my server name is : Point1, exchange domain name: ads and server IP address is: 192.168.15.110
Ex: Point1.ads.local or 192.168.15.110
Click OK
It is done :)

Friday 18 January 2013

HTTP/1.1 200 OK Server: Microsoft-IIS/7.5 , Connection: close


Some time we got the below error while creating a new web application and browsed the site:


 
 
HTTP/1.1 200 OK
Server: Microsoft-IIS/7.5
Date: Tue, 03 Jan 2012 15:44:21 GMT
Connection: close

To resolve the above issue, we have to create a site collection for the site to browse. 

So I created site collection for the new web application
 
Central Administration > Application Management under Site Collections > Create Site Collections 
 
Select the web application and select a template to create site collection.
 
That resolved the issue.

Happy Browsing :)

Friday 4 January 2013

Script to Disable the Fields in NewForm EditForm in SharePoint

Before adding the following script to the NewForm or EditForm we have to give the Reference of jQuery.js and SPServices.js either in Master Page or in the form where you what to add this script.
<script language="javascript" type="text/javascript">
  $(document).ready(function() {
 
      var isUserOnly = false; //User group member only     
      var isAdmin=false;
      var groupName = "Admin Group";
 
   $().SPServices({
      operation: "GetGroupCollectionFromUser",
      userLoginName: $().SPServices.SPGetCurrentUser(),
      async: false,
      completefunc: function(xData, Status)
     
        {
        if($(xData.responseXML).find("Group[Name= Admin Group ']").length == 1)
            {
                isAdmin = true;            
            }
            else
            {
                isUserOnly=true;               
            }
          }
       });
      
       if (isUserOnly)
       { 
            //Disable DropDown
            $("Select[Title='Project']").attr("disabled", "disabled");             
           
           
            var Title =document.getElementById('ctl00_m_g_e8d7e5d3_7fc5_4496_b8b6_00a6a4f46062_ctl00_ctl04_ctl00_ctl00_ctl00_ctl04_ctl00_ctl00_TextField');
Title.disabled=true;
           
var assignedTo = document.getElementById('ctl00_m_g_e8d7e5d3_7fc5_4496_b8b6_00a6a4f46062_ctl00_ctl04_ctl04_ctl00_ctl00_ctl04_ctl00_ctl00_UserField_downlevelTextBox');
assignedTo.disabled=true;
var assignedTodiv = document.getElementById('ctl00_m_g_e8d7e5d3_7fc5_4496_b8b6_00a6a4f46062_ctl00_ctl04_ctl04_ctl00_ctl00_ctl04_ctl00_ctl00_UserField_upLevelDiv');  
assignedTodiv.disabled=true;
var description = document.getElementById('ctl00_m_g_e8d7e5d3_7fc5_4496_b8b6_00a6a4f46062_ctl00_ctl04_ctl03_ctl00_ctl00_ctl04_ctl00_ctl00_TextField');
description.disabled= true;
var description1  = document.getElementById('ctl00_m_g_e8d7e5d3_7fc5_4496_b8b6_00a6a4f46062_ctl00_ctl04_ctl03_ctl00_ctl00_ctl04_ctl00_ctl00_TextField_iframe');
var StartDate = document.getElementById('ctl00_m_g_e8d7e5d3_7fc5_4496_b8b6_00a6a4f46062_ctl00_ctl04_ctl08_ctl00_ctl00_ctl04_ctl00_ctl00_DateTimeField_DateTimeFieldDate');
StartDate.disabled=true;
       
//Disable Calendar Image                   
var imgStartDate = document.getElementById('ctl00_m_g_e8d7e5d3_7fc5_4496_b8b6_00a6a4f46062_ctl00_ctl04_ctl08_ctl00_ctl00_ctl04_ctl00_ctl00_DateTimeField_DateTimeFieldDateDatePickerImage');
imgStartDate.disabled=true;
       
                   
//MultiLine Rich Textbox
description1.disabled = 'disabled';
           
                       
//Disable Dropdown fields
DisableField("Project");
               
//Disable Multiline box     $('#ctl00_m_g_e8d7e5d3_7fc5_4496_b8b6_00a6a4f46062_ctl00_ctl04_ctl03_ctl00_ctl00_ctl04_ctl00_ctl00_TextField_iframe').contents().find('body').attr('disabled','disabled');
//PeoplePicker
$('nobr:contains("Assigned To")').closest("td").next("td").attr("disabled", "disabled");
$("div[id$='_UserField_upLevelDiv']").attr("contentEditable",false);
$("span[id$='_UserField']").find("img").hide();        
           
       }   
 }); 
//Function to Disable DropDown
 function DisableField(title)
{
    for(var i = 0; i < document.all.length; i++)
    {
        var el = document.all[i];
        // find html element with specified title
        if(el.title == title)
        {
            el.disabled = true; // disable
            // if the next element has a reference to the current element
            // then disable if as well
            if(i < document.all.length - 1)
            {
                var el2 = document.all[i + 1];
                if(el2.outerHTML.indexOf(el.id) > 0)
                {
                    el2.disabled = true;
                }
            }
            break;
        }
    }
}
</script>

Wednesday 2 January 2013

Server Error in ‘/’ Application. Runtime Error in Sharepoint2010



Server Error in ‘/’ Application
when ever you are get this error you need do following 3 changes in your web.config file
1.In customErrors tag set mode="Off" to "On
2.In SafeMode tag set CallStack="true" to false
3.In compilation tag debug="false" to true
Now you can see the exact error message in the browser.

Thanks :)