Skip to content

Instantly share code, notes, and snippets.

View devendrasv's full-sized avatar

Devendra Velegandla devendrasv

View GitHub Profile
@devendrasv
devendrasv / gist:6621159
Last active December 23, 2015 10:19
Get Team Site collections and sub sites 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
@devendrasv
devendrasv / GetlistofDocumentlibraries.ps1
Last active December 24, 2015 17:29
Get list of Document libraries where content approval for submitted items is yes
#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)
@devendrasv
devendrasv / Getlistofdoclib.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)
@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)
@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 / 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 / hidechangethelook.css
Created October 27, 2013 02:20
Code to hide the Change the Look
#ctl00_PlaceHolderMain_Customization_RptControls_Theme
{
display:none;
}
@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 / 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"
<?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}"