Skip to content

Instantly share code, notes, and snippets.

View devendrasv's full-sized avatar

Devendra Velegandla devendrasv

View GitHub Profile
@devendrasv
devendrasv / samplesitemap.xml
Created July 5, 2014 01:14
Sample site map
<?xml version="1.0" encoding="utf-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>http://www.sharepoint-journey.com/</loc>
<lastmod>2014-07-05</lastmod>
<changefreq>daily</changefreq>
<priority>0.5</priority>
</url>
@devendrasv
devendrasv / sitemap.ps1
Last active August 29, 2015 14:03
Sitemap for SharePoint
param($Site,$FilePath)
Add-PSSnapin microsoft.sharepoint.powershell -ErrorAction SilentlyContinue
function New-SPSiteMap ($SavePath, $Url)
{
try
{
$site=Get-SPSite $Url
$items = $site.Allwebs | ForEach { $_.Lists } | ForEach-Object -Process {$_.Items}
@devendrasv
devendrasv / Team Name.xml
Created March 3, 2014 22:35
Site Columns
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Field
ID="{2e2aceb0-3c6a-4f9f-ae4e-c6db4dd35d3f}"
Name="SPJ_TeamName"
DisplayName="Team Name"
Type="Text"
Required="FALSE"
Group="SPJ Site Columns">
</Field>
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Field
ID="{6b556d5d-56c6-4923-8ef3-7538ec78251b}"
Name="SPJ_Department"
DisplayName="Department"
Type="Lookup"
Required="FALSE"
Group="SPJ Site Columns"
List="{5b613ab3-6f26-49c3-8d1b-6f3abbb26afd}"
@devendrasv
devendrasv / Elements.xml
Created February 14, 2014 15:24
ListDefinition Elements.xml
<?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 project item, an error will occur when the project is run. -->
<ListTemplate
Name="CustomerListDefinition"
Type="10000"
BaseType="0"
OnQuickLaunch="TRUE"
SecurityBits="11"
Sequence="410"
@devendrasv
devendrasv / Elements.xml
Created February 14, 2014 14:33
CustomActionGroup Elements.xml
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<CustomActionGroup
Id="SharePointJourney.CustomActionGroup"
Location="Microsoft.SharePoint.SiteSettings"
@devendrasv
devendrasv / hidechangethelook.css
Created October 27, 2013 02:20
Code to hide the Change the Look
#ctl00_PlaceHolderMain_Customization_RptControls_Theme
{
display:none;
}
@devendrasv
devendrasv / openlinksinnewwindow.js
Created October 19, 2013 10:46
jQuery to open link in quick launch in new window
<script src="https://ajax.aspnetcdn.com/ajax/jquery/jquery-1.9.0.min.js"></script>
<script type="text/javascript">
$(document).ready(function ($) {
var spjourney = $("a:contains('sharepoint-journey')");
if (spjourney.length > 0) {
$(spjourney).click(function(){
var spjourney_href = $(this).attr("href");
window.open(spjourney_href, "_blank");
return false;
});
@devendrasv
devendrasv / Getcheckedoutitems.ps1
Last active December 24, 2015 23:18
Get all checkedout items in a site collection
#function to get checked-out files
function CheckedOutItems()
{
write-host "Please enter the site url"
#Reading the site collection URL
$url = read-host
#Writing the header text to a file
write ("SiteURL`t" + "FileName`t" + "CheckedOutTo`t" + "ModifiedDate`t"+"Version")
$site = New-Object Microsoft.SharePoint.SPSite($url)
#Getting all sub sites in a site collection
@devendrasv
devendrasv / Getlistofdiclib.ps1
Last active December 24, 2015 17:29
Get all document libraries in a site collection
#Load powershell snapin
Add-PSSnapin "Microsoft.SharePoint.PowerShell"
#Get site collection details
$s = Get-SPSite http://spjourney
#Get all web sites in the site collections
$wc = $s.AllWebs
foreach($w in $wc)
{
#loopthrouh the lists and libraries in the site
foreach($l in $w.Lists)