This file contains hidden or 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
EXEC sp_resetstatus 'SharePoint_Config'; | |
ALTER DATABASE SharePoint_Config SET EMERGENCY | |
DBCC checkdb('SharePoint_Config') | |
ALTER DATABASE SharePoint_Config SET SINGLE_USER WITH ROLLBACK IMMEDIATE | |
DBCC CheckDB ('SharePoint_Config', REPAIR_ALLOW_DATA_LOSS) | |
ALTER DATABASE SharePoint_Config SET MULTI_USER | |
DBCC CheckDB ('SharePoint_Config') |
This file contains hidden or 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
http://siteurl/_layouts/closeConnection.aspx?loginasanotheruser=true |
This file contains hidden or 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 OLECMDID = 6; | |
/* OLECMDID values: * 6 - print * 7 - print preview * 1 - open window * 4 - Save As */ | |
if (navigator.appName == "Microsoft Internet Explorer") | |
{ | |
var PrintCommand = '<object ID="PrintCommandObject" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></object>'; | |
document.body.insertAdjacentHTML('beforeEnd', PrintCommand); | |
if(PrintCommandObject) | |
{ | |
try | |
{ |
This file contains hidden or 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
using System; | |
using System.Web; | |
using System.Web.Services; | |
using System.Web.Services.Protocols; | |
using System.DirectoryServices; | |
using System.Collections.Generic; | |
[WebService(Namespace = "http://tempuri.org")] | |
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] | |
public class AppServerService : System.Web.Services.WebService |
This file contains hidden or 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-PsSnapin Microsoft.SharePoint.PowerShell | |
#Do not modify anything in the script from here onwards | |
function Get-ScriptDirectory | |
{ | |
$Invocation = (Get-Variable MyInvocation -Scope 1).Value | |
Split-Path $Invocation.MyCommand.Path | |
} | |
function Deploy-Solution{ |
This file contains hidden or 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
Usage | |
If you’re saving the script to a file, say “Remove-AllSPSolutions.ps1” then remember to load the script before invoking it with: | |
. .Remove-AllSPSolutions.ps1 | |
You can uninstall all deployed solutions with the following command: | |
Uninstall-AllSPSolutions -Confirm | |
And then remove them with: |
This file contains hidden or 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 Usage: | |
1. Copy paste the below script in a text file and save the file as say “CleanupFarmSolutionStore.ps1″. | |
2. Run SharePoint 2010 Management Shell and change directory to where you saved above file. | |
3. Run command as > .\CleanupFarmSolutionStore.ps1 -Confirm $false | |
Note: Setting parameter -Confirm to false will not ask for confirmation before uninstalling and removing the solution from farm solution store. Set it to true for asking the confirmation. |
This file contains hidden or 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
F5 / Ctrl+F5 - Debugging | |
Ctrl-M + Ctrl-O - collapse all code to definitions. | |
Ctrl-M + Ctrl-P - used to expand all code. | |
Ctrl-K + Ctrl-S is used to surrounded a block of code to an specific block or control. | |
Ctrl-(+) + Ctrl-. - Resolve namespace |
This file contains hidden or 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
powershell -ExecutionPolicy unrestricted -command blue_green_deploy.ps1 | |
-buildZipFile package.zip -server WEBSERVER -siteName WebSite | |
-blueIISPath D:\Web_Blue\ -blueNetworkPath \\WEBSERVER\Web_Blue\ | |
-greenIISPath D:\Web_Green\ -greenNetworkPath \\WEBSERVER\Web_Green\; |
This file contains hidden or 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
$apppool = [Microsoft.SharePoint.Administration.SPWebService]::AdministrationService.ApplicationPools | |
$appPoolStatus = Get-WebAppPoolState $apppool.name | |
$appPoolStatus.Value |