Skip to content

Instantly share code, notes, and snippets.

View devendrasv's full-sized avatar

Devendra Velegandla devendrasv

View GitHub Profile
@devendrasv
devendrasv / firstapplication.aspx
Created June 12, 2013 11:35
Application page
<%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>
<%@ Import Namespace="Microsoft.SharePoint.ApplicationPages" %>
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
<%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Assembly Name="Microsoft.Web.CommandUI, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="FirstApplication.aspx.cs" Inherits="Application.Layouts.Application.FirstApplication" DynamicMasterPageFile="~masterurl/default.master" %>
<asp:Content ID=
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Field Type="Choice"
DisplayName="Incident Type"
Required="FALSE"
EnforceUniqueValues="FALSE" Indexed="FALSE"
Format="Dropdown"
FillInChoice="FALSE"
ID="{bbbc46bb-5217-473a-b522-6761d0d997cf}"
StaticName="IncidentType"
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<!-- Parent ContentType: Item (0x01) -->
<ContentType ID="0x01000bc0b06140de4019aa00b227a8d5a35c"
Name="IncidentDetailsCT"
Group="Custom Content Types"
Description="My Content Type"
Inherits="TRUE"
Version="0">
<FieldRefs>
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<ListInstance Title="Incident Info"
OnQuickLaunch="TRUE"
TemplateType="20000"
Url="Lists/Incident Info"
Description="My List Instance">
</ListInstance>
</Elements>
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<!-- Do not change the value of the Name attribute below. If it does not match the folder name of the List Definition project item, an error will occur when the project is run. -->
<ListTemplate
Name="Incident ListDefinition"
Type="20000"
BaseType="0"
OnQuickLaunch="TRUE"
SecurityBits="11"
Sequence="410"
<?xml version="1.0" encoding="utf-8"?>
<List xmlns:ows="Microsoft SharePoint" Title="Incident Details" FolderCreation="FALSE" Direction="$Resources:Direction;" Url="Lists/ListDefinition-Incident ListDefinition" BaseType="0" xmlns="http://schemas.microsoft.com/sharepoint/">
<MetaData>
<ContentTypes>
<ContentTypeRef ID="0x01000bc0b06140de4019aa00b227a8d5a35c"/>
<ContentTypeRef ID="0x01">
<Folder TargetName="Item" />
</ContentTypeRef>
<ContentTypeRef ID="0x0120" />
</ContentTypes>
@devendrasv
devendrasv / publishing activate feature.ps1
Last active December 20, 2015 03:19
Activate publishing activate feature
$siteUrl = "http://sharepoint-journey.com/sites/appdevelopment"
$siteCollection = Get-SPSite $siteUrl
Enable-SPFeature "PublishingSite" -Url $siteCollection.Url -force
@devendrasv
devendrasv / Activate-Publishing-Feature-using-Stsadm
Last active December 20, 2015 03:19
Activate Publishing Feature using Stsadm
stsadm -o activatefeature -filename publishingSite\feature.xml -url -force "http://sharepoint-journey.com/sites/appdevelopment"
@devendrasv
devendrasv / gist:5d6feca4d54c9ac1ee8a
Last active December 23, 2015 06:19
Export wsps in sharepoint farm
(Get-SPFarm).Solutions | ForEach-Object{$var= "C:\WSP" + "\" + $_.Name; $_.SolutionFile.SaveAs($var)}
@devendrasv
devendrasv / gist:6621125
Last active December 23, 2015 10:19
Get Site collection and sub site last modified date and size in a web application
#constructing table
$a = "<style>"
$a = $a + "BODY{background-color:#ffffff;}"
$a = $a + "TABLE{border-width: 1px;border-style: solid;border-color: ;border-collapse: collapse;}"
$a = $a + "TH{border-width: 1px;padding: 0px;border-style: solid;border-color: black;background-color:wheat}"
$a = $a + "TD{border-width: 1px;padding: 0px;border-style: solid;border-color: black;background-color:PaleGoldenrod}"
$a = $a + "</style>"
#Getting the list of site collection from the webapplication and stroing in an array
[array]$sites= get-spwebapplication http://sharepoint-journey.com| get-spsite -Limit All