This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Declare @Prefix varchar(255) | |
Declare @tmpstr varchar(MAX) | |
Set @Prefix = ' | |
exec master.dbo.sp_addsrvrolemember @loginame=''' | |
Set @tmpstr='' | |
Select @tmpstr = @tmpstr | |
+ Case When sysadmin = 1 Then @Prefix + [LoginName] + ''', @rolename=''sysadmin''' Else '' End |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ALTER DATABASE [tempdb] | |
MODIFY FILE ( NAME = N'tempdev' , SIZE = 3480000KB ) | |
ALTER DATABASE [tempdb] | |
ADD File ( NAME = N'tempdev_2', FILENAME = N'G:\database\tempdev_2.ndf' , SIZE = 3480000KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB) | |
ALTER DATABASE [tempdb] | |
ADD File ( NAME = N'tempdev_3', FILENAME = N'G:\database\tempdev_3.ndf' , SIZE = 3480000KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB) | |
ALTER DATABASE [tempdb] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The State Service is required in order to use the out-of-the-box workflows in | |
# SharePoint Server 2010 (e.g. Approval - SharePoint 2010) or any other features | |
# that leverage InfoPath Forms Services. | |
# | |
# When using the Farm Configuration Wizard to configure the State Service, the | |
# resulting database is named StateService_{GUID}. In order to avoid lengthy | |
# database names containing GUIDs, the State Service is configured using PowerShell. | |
function ConfigureStateService( | |
[string] $stateServiceName = $(Throw "Value cannot be null: stateServiceName"), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
################################################# | |
# Add a new Farm Administrator | |
################################################# | |
# Creates a new Farm Administrator | |
$newFarmAdministrator = “MC\Sp.AdminMC" | |
$caWebApp = Get-SPWebApplication -IncludeCentralAdministration | where-object {$_.DisplayName -eq "SharePoint Central Administration v4"} | |
$caSite = $caWebApp.Sites[0] | |
$caWeb = $caSite.RootWeb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var feedManagerEndpoint; | |
// Get the SPAppWebUrl parameter from the query string and build | |
// the feed manager endpoint. | |
$(document).ready(function () { | |
var appweburl; | |
var params = document.URL.split("?")[1].split("&"); | |
for (var i = 0; i < params.length; i = i + 1) { | |
var param = params[i].split("="); | |
if (param[0] === "SPAppWebUrl") appweburl = param[1]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Check to ensure Microsoft.SharePoint.Powershell is loaded | |
$snapin = Get-PSSnapin | Where-Object{$_.Name -eq ‘Microsoft.SharePoint.Powershell’} | |
if ($snapin -eq $null) { | |
Write-Output “Loading SharePoint Powershell Snapin” | |
Add-PSSnapin “Microsoft.SharePoint.Powershell” | |
} | |
$webAppURL = “http://intranet.mycompany.com” | |
#Get the site collection of your content type hub | |
$site = Get-SPSite “$webAppUrl/metadata/contenttypehub” | |
#Get the root web of the about site collection |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Write-Host "===============================================" -ForegroundColor Yellow | |
Write-Host "Adding Timout Value to SharePoint Web.Config" -ForegroundColor Yellow | |
Write-Host "===============================================" -ForegroundColor Yellow | |
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue | |
function RemoveMyEntries($webapp, $Owner) | |
{ | |
$oldMods = @(); | |
$webapp.WebConfigModifications | where-object { $_.Owner -eq $Owner } | foreach-object { $oldMods = $oldMods + $_} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> | |
<script type="text/javascript"> | |
$(document).ready(function () { | |
var userid = _spPageContextInfo.userId; | |
function GetCurrentUser() { | |
var requestUri = _spPageContextInfo.webAbsoluteUrl + "/_api/web/getuserbyid(" + userid + ")"; | |
var requestHeaders = { "accept" : "application/json;odata=verbose" }; | |
$.ajax({ | |
url : requestUri, | |
contentType : "application/json;odata=verbose", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Write-Host "===============================================" -ForegroundColor Yellow | |
Write-Host " Create SharePoint Content-Databases " -ForegroundColor Yellow | |
Write-Host "===============================================" -ForegroundColor Yellow | |
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue | |
#Site to Create | |
$Site = 100 | |
#Site per SPContentDatabase |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var https = require('https'); | |
/** | |
* HOW TO Make an HTTP Call - GET | |
*/ | |
// options for GET | |
var optionsget = { | |
host : 'graph.facebook.com', // here only the domain name | |
// (no http/https !) | |
port : 443, |