The URL is not available, does not reference a SharePoint site, or you do not have permission to connect

I am trying to connect SharePoint URL in dashboard designer,it prompt's a message

"The URL is not available, does not reference a SharePoint site, or you do not have permission to connect"

To know the more information about this
Checked the Event logs ->Event Viewer ->Windows Logs->Application logs

I am getting Error message

SQL database login for 'SharePoint_Config' on instance 'DBServerName' failed. Additional error information from SQL Server is included below.
Login failed for user 'domain\userName'.

This account dont have permissions on the SQL database.
Run this below script in SharePoint 2013 Management Shell

$w = Get-SPWebApplication ("Web Application Name")
$w.GrantAccessToProcessIdentity("domain\userName")

This command will do the following

Creates a domain\userName as a new user for the DB associated with the web application Name.
Assigns db_owner role to domain\userName
It will creates a new schema for domain\user Name


The Datasource cannot be used because PerformancePoint Services is not configured correctly

The Datasource cannot be used because PerformancePoint Services is not configured correctly
When we trying to create a datasource for PerformancePoint Services(PPS),Getting the error.

The Datasource cannot be used because PerformancePoint Services is not configured correctly

This Cause of this error, we did not configured PPS correctly.

Navigate to Central Admin->Application Management->Manage Service Application

Click on the "Performance Point Service" and select the "Performance Point Service Application Settings"

Give  the Unattended Service account Username and Password,Click ok.

Now go and try the selecting the database in Dashboard Designer.


SharePoint Online Real Time Training Contact: JLAKSHMITULASI@GMAIL.COM

How to download all wsp files from Central Admin

How to download all wsp files from Central Admin

If you want to take the backup of all the wsp files from your central admin.

Use this Power shell Script.


$pathName = "c:\WSPFiles\"
foreach ($solution in Get-SPSolution)
   {
 
    $solid = $Solution.SolutionID
    $title = $Solution.Name
    $filename = $Solution.SolutionFile.Name
    $solution.SolutionFile.SaveAs("$pathName\$filename")
}


SharePoint Online Real Time Training Contact: JLAKSHMITULASI@GMAIL.COM

How to download WSP file Central Admin

How to download WSP file Central Admin
Some times we need to take the backup of WSP file,if you don't have back of the old WSP file
we can get it easily from central admin,before deploying the new WSP.

 using power shell run this below script.

$SPFarm = Get-SPFarm
$getWSP = $SPFarm.Solutions.Item(“dotnetsharepoint.wsp”).SolutionFile
$getWSP.SaveAs(“C:\dotnetsharepoint.wsp”)

SharePoint Online Real Time Training Contact: JLAKSHMITULASI@GMAIL.COM

How to configure SharePoint Outgoing Email Settings using powershell

I prepared a script,easy way to configure the outgoing email using powershell.

Here we check the image before executing the script


$SMTPServer = 'mail.dotnetsharepoint.com'
$FromAddress = 'jlakshmitulasi@dotnetsharepoint.com'
$ReplytoAddress = 'jlakshmitulasi@dotnetsharepoint.com'
$Charset = 65001

$CAWebApplication = Get-SPWebApplication -IncludeCentralAdministration | Where { $_.IsAdministrationWebApplication }
$CAWebApplication.UpdateMailSettings($SMTPServer, $FromAddress, $ReplytoAddress, $Charset)


Here we can check the output after executed the script
                            

SharePoint Online Real Time Training Contact: JLAKSHMITULASI@GMAIL.COM

Activating and Deactivating Features in a SharePoint Site Collection Using Power Shell

If we want to know the list of features activated in your Site Collection
Run the following command in SharePoint 2013 Management shell



It will gives list of features with DisplayName,ID

For activating or deactivating  the feature use we can do based on Feature Name or Feature ID

Activating the Feature:

Enable-SPFeature –Identity FeatureIDhere –url  http://DotNetSharePoint:1234/sites/SharePoint
Or
Enable-SPFeature –Identity FeatureNamehere –url  http://DotNetSharePoint:1234/sites/SharePoint


Deactivating the Feature:

Disable-SPFeature –Identity FeatureIDhere –url  http://DotNetSharePoint:1234/sites/SharePoint
Or
Disable-SPFeature –Identity FeatureNamehere –url  http://DotNetSharePoint:1234/sites/SharePoint


SharePoint Online Real Time Training Contact: JLAKSHMITULASI@GMAIL.COM

How to rename WSP file in SharePoint

The SharePoint Project name will come as a WSP name, some time when we need to rename the WSP file.

In Visual Studio->Navigate to Package->Click on the Package.package


Previous I am getting the WSP with name SharePointSolution1.WSP.



Now I want change the Name to DotNetSharePoint 


Save it.

Now I can get WSP name as DotNetSharePoint.WSP

Once it’s done, restart the visual studio get the WSP file with modified name.

SharePoint Online Real Time Training Contact: JLAKSHMITULASI@GMAIL.COM

This control is currently disabled

 When i am  trying to deploy sandbox solution in SharePoint site, it was showing an error as "This control is currently disabled".I am unable to activate the solution as shown below.



 I tried to figure out the solution that "Microsoft SharePoint Foundation Sandboxed Code Service" was not started in central admin .To resolve this issue we have to start the "Microsoft SharePoint Foundation Sandboxed Code Service".

Navigate to CA->Manage Services on Server->









SharePoint Online Real Time Training Contact: JLAKSHMITULASI@GMAIL.COM

How to change the site logo in SharePoint

Sometimes we have to change the site logo based on the requirement, It is very easy to change using the Out of box feature.

Navigate to Site Settings

  Under Look and Feel
   Click on Title, description, logo

Now I am adding the logo from my computer.


Added the image click ok.

If we want to add the logo from SHAREPOINT we can add the image in “15 hive” on the file system then the URL will come as “/_layouts/Images/YourLogname.jpg”.

Logo is changed as shown below.




SharePoint Online Real Time Training Contact: JLAKSHMITULASI@GMAIL.COM

Check the Duplicates Values in SharePoint List

How to Check the Duplicates Values in SharePoint List


<div>
    <label>EmployeeName</label>
    <asp:TextBox ID ="txtempname" runat ="server"></asp:TextBox>
    <asp:Label ID ="lblerror" runat ="server" Text ="Employee Name Already Available" Visible ="false" ForeColor ="Red"></asp:Label>
</div>
<div>
    <asp:Button ID="btnInsert" runat ="server"  Text ="Submit" OnClick="btnInsert_Click" />
</div>


  protected void btnInsert_Click(object sender, EventArgs e)
        {
            using(SPSite site = new SPSite(SPContext.Current.Web.Url))
            {
               using( SPWeb web = site.OpenWeb())
                {
                   SPList list = web.Lists["EmployeeInfo"];
                   SPQuery checkduplicates = new SPQuery();

                   checkduplicates.Query = "<Where><Eq><FieldRef Name='Name' /><Value Type='Text'>" + txtempname.Text.ToString().ToLower() + "</Value></Eq></Where>";
                   SPListItemCollection myListColl = list.GetItems(checkduplicates);
                   if (myListColl.Count > 0)
                   {
                       lblerror.Visible = true;
                     
                   }
                   else
                   {

                       SPListItem item = list.Items.Add();
                       item["Name"] = txtempname.Text;
                       item.Update();
                   }

                }

            }

        }

OutPut:

SharePoint Online Real Time Training Contact: JLAKSHMITULASI@GMAIL.COM

Error occurred in deployment step 'Add Solution': A feature with ID has already been installed in this farm. Use the force attribute to explicitly re-install the feature.

I am trying to deploy the solution using visual studio I am getting the error as shown below.

        Error occurred in deployment step 'Add Solution': A feature with ID  has already been installed in this farm.  Use the force attribute to explicitly re-install the feature.

This error will come mainly the feature is not retracted properly, so I am enable “Always Force Install to True” in our Feature

In our Solution Explorer Double Click on Feature, in properties windows we can able to see as shown below.

By default I will show False, Now I am changing to True.



SharePoint Online Real Time Training Contact: JLAKSHMITULASI@GMAIL.COM

Deploying Custom Master Page in SharePoint

Using Visual Studio I am deploying the master page am creating an Empty Project, in that Feature I am adding a new Feature Scope I am selecting as” Site “and adding the Event Receiver.
I am adding the module it is used to deploy files to the SharePoint Environment,
In That Module I am having sample.txt I am changing it to CustomMaster.master

Finally my solution is looks as shown below.



In Feature1.EventReceiver.cs I am adding the Below code
public override void FeatureActivated(SPFeatureReceiverProperties properties)
        {
            SPSite siteCollection = (SPSite)properties.Feature.Parent;
           SPWeb web = siteCollection.RootWeb;
            Uri masteruri = new Uri(web.Url+"/_catalogs/masterpage/CustomMaster.master");
            web.MasterUrl = masteruri.AbsolutePath;
            web.CustomMasterUrl = masteruri.AbsolutePath;
            web.Update();

        }

        public override void FeatureDeactivating(SPFeatureReceiverProperties properties)
        {
            SPSite siteCollection = (SPSite)properties.Feature.Parent;
            SPWeb web = siteCollection.RootWeb;
            Uri masteruri = new Uri(web.Url + "/_catalogs/masterpage/Seattle.master");
            web.MasterUrl = masteruri.AbsolutePath;
            web.CustomMasterUrl = masteruri.AbsolutePath;
            web.Update();
        }

Module1 in Element.xml I am adding the below lines

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <Module Name="Module1" List="116" Url="_catalogs/masterpage">
    <File Path="Module1\CustomMaster.master" Url="CustomMaster.master" Type="GhostableInLibrary" IgnoreIfAlreadyExists="TRUE" />
  </Module>
</Elements>

Once completed all the steps deploy the solution in visual studio

It will be changed as our custom master as shown below.


SharePoint Online Real Time Training Contact: JLAKSHMITULASI@GMAIL.COM

insert data into sharepoint list using gridview

I will expalin how to insert data into sharepoint list using gridview.
Now i am taking a Visual webpart,in this .ascx i am designing the screen with Employee Information like Name,Location,Phoneno,Designation.
<asp:GridView ID="gridinsertdata" runat="server" AutoGenerateColumns="False"
    CellPadding="4"   ShowFooter="True"
    onrowcommand="gridinsertdata_RowCommand" Width="700px">
        <Columns>
            <asp:TemplateField>
            <HeaderTemplate>
            <table width="100%" cellpadding="0" cellspacing="0">
            <tr>
            <td width="20%">
            Name
            </td>
             <td width="20%">
            Location
            </td>
             <td width="40%">
           Phoneno
            </td>
                <td width ="40%" >

                    Designation
                </td>
            </tr>
            </table>
            </HeaderTemplate>
            <ItemTemplate >
            <table width="100%" cellpadding="0" cellspacing="0">
            <tr>
            <td align="center" width="20%">
            <%#Eval("Name") %>
            </td>
              <td align="center" width="20%">
             <%#Eval("Location") %>
            </td>
             <td align="center" width="40%">
            <%#Eval("Phoneno") %>
            </td>
                   <td align="center" width="40%">
            <%#Eval("Designation") %>
            </td>
            </tr>
            </table>
            </ItemTemplate>
            <FooterTemplate>
            <table  cellpadding="0" cellspacing="0">
            <tr>
            <td align="center" width="20%">
            <asp:TextBox ID="txtname" runat="server"></asp:TextBox>
            </td>
            <td align="center" width="40%">
            <asp:TextBox ID="txtlocation" runat="server"></asp:TextBox>
            </td>
            <td align="center" width="40%">
            <asp:TextBox ID="txtphoneno" runat="server"></asp:TextBox>
                </td>
                   <td align="center" width="40%">
            <asp:TextBox ID="txtdesignation" runat="server"></asp:TextBox>
                       </td>
                <td>
                       <asp:Button ID ="btnSave" runat ="server" Text ="Save" CommandName ="Insert" />
                </td>
                       </tr>
            </table>
            </FooterTemplate>
            </asp:TemplateField>
        </Columns>
     
        </asp:GridView>

Now in .cs  writing the logic as shown below.

        protected void Page_Load(object sender, EventArgs e)
        {
            if(!Page.IsPostBack)
            {
                bindGrid();
            }
        }

        public void bindGrid()
        {

            SPWeb web = SPContext.Current.Web;
            SPList list = web.Lists["EmployeeInfo"];
            SPListItemCollection listcoll = list.Items;
            gridinsertdata.DataSource = listcoll.GetDataTable();
            gridinsertdata.DataBind();
        }
        protected void gridinsertdata_RowCommand(object sender, System.Web.UI.WebControls.GridViewCommandEventArgs e)
        {
            if(e.CommandName == "Insert")
            {

                SPWeb web = SPContext.Current.Web;
                SPList list = web.Lists["EmployeeInfo"];
                SPListItemCollection myColl = list.Items;
                TextBox txtname = (TextBox)gridinsertdata.FooterRow.FindControl("txtname");
                TextBox txtlocation = (TextBox)gridinsertdata.FooterRow.FindControl("txtlocation");
                TextBox txtphoneno = (TextBox)gridinsertdata.FooterRow.FindControl("txtphoneno");
                TextBox txtdesignation = (TextBox)gridinsertdata.FooterRow.FindControl("txtdesignation");
                SPListItem item = myColl.Add();
                item["Name"] = txtname.Text;
                item["Location"] = txtlocation.Text;
                item["Phoneno"] = txtphoneno.Text;
                item["Designation"] = txtdesignation.Text;
                item.Update();

                bindGrid();

            }

        }

Output:


SharePoint Online Real Time Training Contact: JLAKSHMITULASI@GMAIL.COM

Enable PowerShell ISE windows server 2008 r2

Enable PowerShell ISE windows server 2008 r2
In windows 7 or Windows Server 2008 R2 we cannot find the PowerShell ISE in start menu.
If we want to enable using power Shell
Open the Power Shell run the following commands

 1)Import Module Server Manager

Import-Module  ServerManager

2)Now Search for PowerShell ISE Feature

Get-WindowsFeature  -Name *PowerShell*

3)Now Add the Feature

Add-WindowsFeature PowerShell-ISE  



After executing the above commands we can find the PowerShell ISE in Start Menu

SharePoint Online Real Time Training Contact: JLAKSHMITULASI@GMAIL.COM

How to check the site template of SharePoint site

How to check the site template of SharePoint site
Sometimes we have to know which site we are using in SharePoint, It is very simple using the browser we can find the site we are using.
Right click on the browser click on View Source.
Find using the “SiteTemplateId”
We can find Site Template ID Name as shown below
var g_wsaSiteTemplateId = 'BLANKINTERNET#0';

For More Information we can find the site templates with ID, Name, and Title.



SharePoint Online Real Time Training Contact: JLAKSHMITULASI@GMAIL.COM