Site Collection Operations in SharePoint 2013

Site Collection Operations in SharePoint 2013
           SharePoint 2013  Site Collection Operation is much easier using SPSite Powershell Cmdlet. Here we can see few new parameters in SharePoint 2013 SPSite.

  • Url and OwnerAlias
  • HostHeaderWebApplication
  • DestinationDatabase

New-SPSite


    The New SPSite cmdlet creates a new site collection with "URL and OwnerAlias" parameters.  specify This cmdlet can create site collections in either the SharePoint Server 2010 mode which uses the legacy 2010 versions of templates and features, or can be created in SharePoint Server 2013 mode which uses the new versions of templates and features.

Example:
            New-SPSite http://<sitename>/sitees/newsite  -OwnerAlias "Domain\AdminName" -Language 1033 -Template 'STS#0'

Move-SPSite

                           Move-SPSite cmdlet moves the data in the specified site collection from its current content database to the content database specified by the "DestinationDatabase" parameter. A no-access lock is applied to the site collection to prevent users from altering data within the site collection while the move is taking place. Once the move is complete, the site collection is returned to its original lock state. The destination content database specified must already exist, must be attached to the same SQL Server as the site collection's current content database, and must be attached to the site collection's current Web application.

   After run the Move-SPSite cmdlet ,run the IISRESET command to update changes to IIS.

Example:

               Move-SPSite http://servername/sites/sitename  -DestinationDatabase ContentDb6

  It moves the site collection http://servername -DestinationDatabase ContentDb6

Host-name site Collection 

             It allows to create a Host-name Site Collections adding ,using the "HostHeaderWebApplication" ParameterIt idetifies the Web Application where the site collection is being Created.

Example:

         New-SPSite SiteCollectionURL -HostHeaderWebApplication 'WebAppURL' -Name 'TopLevelSite' -Description 'Top Level Site Collection' -OwnerAlias 'Domain\administrator' -language 1033 -Template 'STS#0'

how to populate values in dropdownlist from database using asp.net

In this article we can able to see  how to Populate values in to drop down from Data Base using asp.net

 public void loadDdlRoles()
        {

            string constr = ConfigurationManager.ConnectionStrings["DConnectionString"].ToString(); // connection string
            SqlConnection con = new SqlConnection(constr);
            con.Open();

            SqlCommand com = new SqlCommand("select *from dbo.aspnet_Roles", con); // table name 
            SqlDataAdapter da = new SqlDataAdapter(com);
            DataSet ds = new DataSet();
            da.Fill(ds);  // fill dataset
            DdlRoles.DataValueField = ds.Tables[0].Columns["RoleName"].ToString();             // to retrive specific  textfield name 
            DdlRoles.DataSource = ds.Tables[0];      //assigning datasource to the dropdownlist
            DdlRoles.DataBind();  //binding dropdownlist


        }
Don't Forget to call that method in Page load

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

        }
Keep always Smile:)

Display Data in Grid View

Hi Friends
In this article i will explain how to display data in grid view.
Step 1:
We created a database dotnetdb and with  table name Employee.

USE [dotnetdb]
GO

/****** Object:  Table [dbo].[Employee]    Script Date: 01/03/2015 15:25:10 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[Employee](
[EmpId] [nvarchar](50) NOT NULL,
[EmpName] [nvarchar](50) NOT NULL,
[EmpAddress] [nvarchar](50) NOT NULL,
[EmpDesignation] [nvarchar](50) NULL
) ON [PRIMARY]

GO

Step 2:

We created a empty web application with name GridView and selected a WebForm and renamed with name  Displaydata.aspx.

UI Screen


<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Displaydata.aspx.cs" Inherits="GridView.Displaydata" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
     <asp:GridView ID="GridView1" runat="server">
    </asp:GridView>
    </div>
   
    </form>
</body>
</html>
Step:3

Businesslogic.

In Displaydata.aspx.cs write the business logic.


using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Data;

namespace GridView
{
    public partial class Displaydata : System.Web.UI.Page
    {
        SqlConnection con = new SqlConnection("Data Source = Chinnu;Initial Catalog = dotnetdb;uid = sa;password = password123;");
        protected void Page_Load(object sender, EventArgs e)
        {
            dataBindGrid();
        }

        public void dataBindGrid()
        { 
            SqlDataAdapter da = new SqlDataAdapter("select * from Employee",con);
            DataSet ds = new DataSet();
            da.Fill(ds); 
            GridView1.DataSource = ds;
            GridView1.DataBind(); 
        }
    }
}

Output:Finally Press F5 we can able to see the Output.







    
  


How to create Lookup Field List using Power shell Script in SharePoint 2013

How to create Lookup Field List using Power shell Script in SharePoint 2013
Continution to Previous post  , here we are going to see how to create lookup field from Power Shell  in SharePoint 2013

 Create a SharePoint Custom List Department with Lookup Column

SNAME    -  Lookup
SID -Number

#List type or template
$spTemplate = $spWeb.ListTemplates["Custom List"]

#Get all the lists to the listcollection
$spListCollection=$spWeb.Lists

#adding the new list to the list collection
$spListCollection.Add("Department","Department",$spTemplate)

#get the path of subsite and sitecollecion
$path = $spWeb.url.trim()

#get the list to the list object
$spList = $spWeb.GetList("$path/Lists/Department")

#adding the field type(Lookup) to the list
$LookupList= $spWeb.Lists["Student"]
$fieldXml='<Field Type="Lookup" DisplayName="SName" ShowField="SName" StaticName="SName" List="' + $LookupList.id + '" Name="SName"></Field>'
$spList.Fields.AddFieldAsXml($fieldXml,$true,[Microsoft.SharePoint.SPAddFieldOptions]::AddFieldToDefaultView)

#adding the field type(Number) to the list
$spFieldType = [Microsoft.SharePoint.SPFieldType]::Number
$spList.Fields.Add("SID",$spFieldType,$false)

$Views = $spList.Views["All Items"]
$Views.ViewFields.Add("SID")
$Views.Update()

How to create List using Power shell Script in SharePoint 2013

How to create List using Power shell Script in SharePoint 2013
In this post we are going to see how to create Custom List from Power Shell in SharePoint 2013.
How to add fields to list in sharepoint using powershell - See more at: http://www.dotnetsharepoint.com/#sthash.vM7z4E6E.dpuf
How to add fields to list in sharepoint using powershell
Copy value from one filed to another field using PowerShell
Add X years to date column based on item created date in SharePoint PowerShell
How to import users from CSV to SharePoint site using PowerShell
How to update the modified by using power shell
How to add column in to List using Power Shell
Date formula in SharePoint calculated value

Create a SharePoint Custom List  Student Info with Columns
SNo    -  Number
SName  -  Text
Gender -  Choice
Photo  -  URL

#To which site u want to create the list
$spWeb=Get-SPWeb -Identity http://c4968397007

#List type or template
$spTemplate = $spWeb.ListTemplates["Custom List"]

#Get all the lists to the listcollection
$spListCollection=$spWeb.Lists

#adding the new list to the list collection
$spListCollection.Add("Studentlist","Studentlist",$spTemplate)

#get the path of subsite and sitecollecion
$path = $spWeb.url.trim()

#get the list to the list object
$spList = $spWeb.GetList("$path/Lists/Studentlist")

#adding the field type(Number) to the list
$spFieldType = [Microsoft.SharePoint.SPFieldType]::Number
$spList.Fields.Add("SNo",$spFieldType,$false)

#adding the field type(Text) to the list
$spFieldType = [Microsoft.SharePoint.SPFieldType]::Text
$spList.Fields.Add("SName",$spFieldType,$false)

#adding the field type(choice) to the list
$choices = New-Object System.Collections.Specialized.StringCollection
$choices.Add("Female")
$choices.Add("Male")
$spFieldType = [Microsoft.SharePoint.SPFieldType]::Choice
$spList.Fields.Add("Gender",$spFieldType,$false,$false,$choices)

#adding the field type(url) to the list
$spList.Fields.Add("Photo","URL",$false)

$Views = $spList.Views["All Items"]
$Views.ViewFields.Add("SNo")
$Views.ViewFields.Add("SName")
$Views.ViewFields.Add("Gender")
$Views.ViewFields.Add("Photo")

$Views.Update()

Managed meta data navigation in sharepoint 2013

We can manage navigation of site collection using Meta data in SharePoint 2013. Managed Meta data navigation and friendly URL is a new feature in SharePoint 2013. We can have the term store to create and store the navigation. We have to create managed Meta data service. To enable Meta data navigation, activate publishing feature at site collection level.


Go to site settings, in the “Look and Feel” section, select “Navigation”



Select Managed navigation for top navigation as shown in the image below,



In the term store management (In Site settings, Site Administration group, select “Term store Management”)

Create term in Site Collection navigation as shown in the image below.



By adding the terms in term store tool, we can see the tabbed view as in the image below. In “GENERAL” tab, we can see the general properties of the term like Name, Available for tagging...



“NAVIGATION” section allows us to create friendly URL’s for the navigation. If we select, “term-Driven Page with Friendly URL”, it will choose the default URL. By selecting “Simple Link or Header”, we can assign the custom link to the navigation.



In “TERM-DRIVEN PAGES”, tab, we can have the option to configure the friendly URL and allows to set an image.




“CUSTOM PROPERTIES” tab allows us to add “Shared Properties” and “Local Properties”.



Create the navigation as the structure shown below.




After saving the navigation, we can see it as the image below.







SharePoint 2013 PerformancePoint Services Configuration

Configuring PerformancePoint Services (PPS) 

   For configuring PPS, one should complete the following three steps to use PerformancePoint features. The three important steps are:
  • Start a Secure Store Service and Performance Point Service at farm level via Central Admin. 
  • Configure the Secure Store Service. 
  • Configure the PPS application. 
1 .Start Secure Store Service and Performance Point Service

To start configuration of the Secure Store Service and PerformancePoint Service, we have to start on the Farm. For that go to CA -> Application Management -> Service Application ->  Manage Service on server.
Here on this page there are many services available. Out of these services, start Performance Point Service and Secure Store Service as shown below:
This will allow configuring further steps. 

2. Configure the Secure Store Service 

  The Secure Store Service is an authorization service that runs on an application server. It provides a database that is used to store credentials. These credentials usually consists of username and passwords but can also contain some other fields. Then these credentials can be used to connect external systems like PerformancePoint Services, BCS, Excel Services, Visio Services etc.. 

     The first time you access the Secure Stored Services it will ask you generate a new encryption key. This key will be used to encrypt and decrypt credentials stored in Secure store.


To configure the Secure Store Service, enter Central Admin -> Application Management -> Manage service applications.










Here on this page there are many services application available. Out of these services application, select Secure Store Service as shown below:













Once the Secure Store page open then there is no key generated which would encrypt the credentials. To create a new key, click on “Generate new key” on the top ribbon.










A pass phrase needs to be created to encrypt the key. Accept the check to Re-encrypt the Database Using the New Key and click OK.
















3 Configuring the PPS application

       The PerformancePoint Service is a SharePoint Server 2013 service application. It enables users to create business intelligence(BI) dashboards that provide insight into an organization’s performance. It help you create scorecards, and key performance indicators(KPIs) in web browsers, that can aggregate their content from multiple sources and help companies make important decisions.

    Once the Secure Store service is configured then to configure the PerformancePoint service application, re-enter CA -> Application Management -> Manage service applications.




Here on this page there are many services application available. Out of these services application, select PerformancePoint service application as shown below:




There will be several options such as defining the trusted data source location or content locations, importing PPS content and others. For our purpose, click on "PerformancePoint Service Application Settings".





By default the Secure Store Service name will be pre-populated. In order to configure the unattended account, provide an appropriate username and password and click OK.






facing issues while Configuration PerformancePoint Services we can check below.











Labels

.Net Interview Questions add custom button in sharepoint using javascript Add custom column property into a PageLayout in SharePoint Add Page Title on their browser's title bar in SharePoint Customly add zip files in blogger Add-SPOSiteCollectionAppCatalog : Must have Manage Web Site permissions or be a tenant admin in order to add or remove sites from the site collection app catalog allow list Advance SmartObject An error occurred while accessing the resources required to serve this request. The server may not be configured for access to the requested URL. Angular 2 Angular JS Angularjs Angularjs 1 anonymous users accessing lists and libraries App Permissions for SharePoint 2013 asp.net membership unique email Asp.net TreeView Control asp.net. Attendees in SharePoint Auto refresh list using Content Editor WebPart in SharePoint 2013. Auto Refresh SharePoint list using JavaScript Block and unblock of attachment types in SharePoint Blogger C# Callouts in SharePoint 2013 Cascading Dropdown list in SharePoint change onenote to another location. change SuiteBarLeft in SharePoint 2013 check if userid exists in database c# click node text to expand/collapse in Treeview client object model Close webpart CQWP crate chart using BI site in PPS Create a modern team site collection in SharePoint online Create BI chart in PPS SharePoint 2013 create filter in dashboard designer. create kpi's in dashboard designer create kpi's in SharePoint 2013 dashboard designer Create List Create List In SharePoint Create List using Power Shell Script Create Lookup Field in List using Power Shell Script Create lookup field in List create SharePoint List custom view. create SharePoint List views in List Schema create site collection in site collection in SharePoint using powershell created Date Time calculated field in SharePoint Cross site Collection in SharePoint 2013 Crud Operation in Asp.net Using Stored Procedure Custom MasterPage Approval in SharePoint custom view for survey list Customly add SharePoint List view in Page. delete items in sharepoint using powershell Difference between Angular 1.x & Angular 2 difference between Office 365 and Windows Azure difference between Windows Azure and Office 365 in sharepoint? DifferenceBetween discussion board Display Data in Grid View display radio buttons and choice fields horizontally in SharePoint 2013 Document library DotNet Drag and drop documents in document library in SharePoint dynamically populating values from one list to another list using jquery in sharepoint edit and delete buttons in datagridview Edit Links email notification using Nintex enable anonymous access in SharePoint 2013 enable app catalog sharepoint online site collection powershell Enable appcatalog site collection level using PowerShell based on Input file Enable versions for list and library except the hidden lists using PowerShell Script Error occurred in deployment step 'Recycle IIS Application Pool': Cannot resolve model for the project package Errors&Solutions Export document library in sharepoint using powershell Export particular Group in Term Store Management in SharePoint 2013 Export to Excel first release Flow Flow features free disk space on servers using powershell Friendly URLs and Managed Navigation in SharePoint 2013 get a list of site collection with template in web application using PowerShell Script in SharePoint Get attachments in SharePoint custom list using c# get current list item id sharepoint programmatically Get current url using jquery Get data from SharePoint list using Rest api & Angular JS Get Random Get Random SharePoint items using PowerShell Get Random values from SharePoint list using PowerShell Get url of the last value using jquery Get-SPOSite : The managed path sites/yoursitename is not a managed path in this tenant. Getting Email From User Hide “Edit Links” in left navigation SharePoint 2013 hide button in sharepoint based on permissions Hide column in SharePoint List view hide fields using client side object model Hide list in Quick Launch in SharePoint using PowerShell How to add Custom Tiles to SharePoint site Page. How to add extension files in Search Navigation in SharePoint 2013 How to Add Multiple users Using SharePoint People Picker How to add SharePoint list view in Page using C# How to Approve MasterPage using PowerShell in SharePoint How to bind Multiple users Using SharePoint People Picker how to change indicators on kpi performance how to check if an email address already exists in the database in asp.net how to configure workflow manager platform for SharePoint 2013 how to create calculated value using powershell how to create certificate in SharePoint How to create flow. how to create gantt chart webpart in sharepoint how to create KPI indicators in Dashboard designer How to create moden communication site in SharePoint online How to create Multi selected filter in Dashboard How to create nintex workflow in sharepoint how to create rdlc reports in asp.net How to Display Data Grid View in ASP.net How to enable anonymous access in SharePoint How to find data in datagridview in c# How to get image names from the folder using C# how to get particular list content type id in SharePoint 2013 How to get QueryString value in SharePoint WebPart Programatically how to get the current item id for newly created item using REST API and JQuery how to hide list in sharepoint how to know who created list in sharepoint How to make a Site Collection Read-Only in SharePoint 2010 How to overlay Office 365 shared calendar on SharePoint Site how to pass jquery value to asp.net textbox control How to pass pagename as a browser's title bar in the page how to remove unused Application Pool in SharePoint how to remove zone using powershell script How to send mail to particular group of people using PowerShell how to update modified by and created by using powershell how to uplaod RAR files in blogger import csv data into sharepoint import data using powershell Import group to term store management using SharePoint 2013. InfoPath InfoPath Cascading Dropdown list Insert update delete in datagridview in C# winforms Integration from SharePoint to k2. K2 Smart Forms for SharePoint JavaScript Injection jquery K2 blackpearl K2 Designer K2 Designer Workflow. K2 smartform cascading dropdown list k2 Workflow K2 workflow to send a mail with PDF left navigation Local Term Set in managed meta data Managed meta data navigation in SharePoint 2013 Managed metadata service in SharePoint 2013. Managed Navigation in SharePoint 2013. Managed Promoted Sites. meta data navigation Microsoft Flow New Features New-SPConfigurationDatabase The user does not exist or is not unique NintexWorkFlow Office 365 OneNote overwrite existing document in sharepoint using javascript PDF Converter PDF Method in K2 Performance Point Service in SharePoint 2013 PerformancePoint Services Configurtion PerformancePoint Services Configurtion for SharePoint 2013 PerformancePoint Services in SharePoint Server 2013 Popularity trends in SharePoint 2013 Pages populate dropdown list dynamicallyusing jquery Power Shell Power shell script to get SharePoint site size. powershell read xml PowerShell Script PowerShell script to get list of users from SharePoint groups PowerShell Scripts in SharePoint 2013 Powershell to set the masterpage in SharePoint Promoted Links Promoted Sites psconfig.exe quick launch Rdlc reports Readonly Column in SharePoint Editview Realtime DotNet Interview Questions Recent Dotnet interview questions Recent SharePoint interview questions recover deleted OneNote page. OneNote content is missing Regional Settings in SharePoint 2013 Replace New Item text in SharePoint Rest API Schedule PowerShell Script Search in SharePoint 2013 Search navigation in SharePoint 2013 Secure store service SecureStore Services SecureStore Services configuration for SharePoint 2013 self-signed certificate on IIS Server Send email to members of SharePoint Group using PowerShell sharepint2010 sharepoin2010 SharePoint 2013 SharePoint 2010 SharePoint 2013 SharePoint 2013 Dashboard Designer SharePoint 2013 features SharePoint 2013 Interview Questions SharePoint 2013. SharePoint 2013.disable views from user to create SharePoint 2013.Power shell SharePoint 2013.SharePoint 2010 SharePoint 2016 SharePoint Administration SharePoint Alerts and Reminders SharePoint App Configuration SharePoint Apps SharePoint Bulk upload SharePoint Calculated field SharePoint Calendar View sharepoint interview questions SharePoint online training SharePoint Onprem vs Online SharePoint RealTime Online Training SharePoint2010 SharePoint2013 SharePoint2016 SharePointInterview SharePointOnline SharePointOnline;Restore deleted site;SharePoint 2013 show data in datagridview in C# Simple Insert update Delete Retrieve Clear in asp.net. Site Collection Operations in SharePoint 2013 Site Collection Read-Only in SharePoint 2013 site contents Sorting & Filtering SPSite Site Collection Operation parameters in SharePoint 2013 Step by step to create rdlc report in .Net Store names in text files in C# Sub site Subsite Term store management. The server was unable to save the form at this time. please try again UI New look update created by using client side object model update field values in SharePoint using powershell update items in SharePoint list using client object model update modified by field using client side object model upload zip files in blog use IsNullOrEmpty in PowerShell VirtoSoftware VirtoSofware vitrosoftware WebParts what is Document Set in SharePoint 2010 What is Filter in SharePoint Dashboard what is Limited-access user permission lock down mode feature What is Modern Team site What is Target Audience in SharePoint Who Created Site Using PowerShell Workflow in SharePoint 2013 Workflow management platform in SharePoint 2013 Workflow manager for SharePoint 2013 XSL-Template.