Skip to content

Instantly share code, notes, and snippets.

Add-PSSnapin Microsoft.SharePoint.PowerShell
$webapp= Get-SPWebApplication "http://www.sharepoint-journey.com/"
# looping through all sitecollections
foreach($site in $webApp.Sites)
{
# looping through all sites
foreach($website in $site.allwebs)
{
#Example of getting site collection url based on feature Name
Add-PSSnapin Microsoft.SharePoint.PowerShell
$webapp= Get-SPWebApplication "http://www.sharepoint-journey.com/"
# looping through all sitecollections
foreach($site in $webApp.Sites)
{
<?xml version="1.0" encoding="utf-8" ?>
<!--Created:cb85b80c-f585-40ff-8bfc-12ff4d0e34a9-->
<App xmlns="http://schemas.microsoft.com/sharepoint/2012/app/manifest"
Name="Search-Students"
ProductID="{3b9c0cc0-ae95-47cc-889c-450ff2646405}"
Version="1.0.0.0"
SharePointMinVersion="15.0.0.0"
>
<Properties>
<Title>Search-Students</Title>
$(document).ready(function () {
var e = ExecuteOrDelayUntilScriptLoaded(
SearchStudents,
"sp.js");
});
function SearchStudents() {
$("#SearchStudentsDiv").show();
}
<%-- The following 4 lines are ASP.NET directives needed when using SharePoint components --%>
<%@ Page Inherits="Microsoft.SharePoint.WebPartPages.WebPartPage, Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" MasterPageFile="~masterurl/default.master" Language="C#" %>
<%@ Register TagPrefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%-- The markup and script in the following Content element will be placed in the <head> of the page --%>
<asp:Content ContentPlaceHolderID="PlaceHolderAdditi
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<CustomAction Id="21c1f1f7-70ad-4a02-92e1-444cb991c251.App-MenuItemCustomAction"
RegistrationType="List"
RegistrationId="100"
Location="EditControlBlock"
Sequence="10001"
Title="My App Part">
<!--
Update the Url below to the page you want the custom action to use.
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<CustomAction Id="9b3d1a59-78ca-45da-aa2c-4964e3f68c58.AppHost-RCA"
RegistrationType="List"
RegistrationId="100"
Location="CommandUI.Ribbon"
Sequence="10001"
Title="Invoke &apos;AppHost_RCA&apos; action">
<CommandUIExtension>
<!--
function helloAppPart()
{
document.getElementById("AppPartmessage").innerHTML = "<p> My first AppPart </p>";
}
<%@ Page language="C#" Inherits="Microsoft.SharePoint.WebPartPages.WebPartPage, Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ 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="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<WebPartPages:AllowFraming ID="AllowFraming" runat="server" />
<html>
<head>
<title></title>
<table width="700" height="100" border="1" align="center" cellpadding="10">
<tr border="0">
<td height="10" colspan="2"><h2 style="text-align:center;color:blue"><a href="http://www.sharepoint-journey.com/" title="Learn SharePoint and Provide Solutions to Business Problems">Home</a</td> </tr>
<tr> <td width="233" align="left" valign="top"><h3 align="center"><a href="http://www.sharepoint-journey.com/sharepoint-tutorials.html" title="SharePoint Tutorials">Tutorials</a></h3>
<a href="http://www.sharepoint-journey.com/what-is-sharepoint.html" title="what is sharepoint ?">what is sharepoint</a><br />
<a href="http://www.sharepoint-journey.com/sharepoint-features.html" title="sharepoint features">sharepoint features</a><br />
<a href="http://www.sharepoint-journey.com/enterprise-search-configuration-in-sharepoint-2013.html" title="Enterprise search configuration in SharePoint 2013">search configuration in SharePoint 2013</a><br />
<a href="http://www.sharepoint-journey.com/sharepoint-webparts