param(
)
function Ensure-PSSnapin
{
if ((Get-PSSnapin "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue) -eq $null)
{
Add-PSSnapin "Microsoft.SharePoint.PowerShell" -Verbose:$false
Write-Verbose "SharePoint Powershell Snapin loaded."
}
}
function Release-PSSnapin
{
if ((Get-PSSnapin "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue) -ne $null)
{
Remove-PSSnapin "Microsoft.SharePoint.PowerShell" -Verbose:$false
Write-Verbose "SharePoint Powershell Snapin removed."
}
}
Ensure-PSSnapin
$gc = Start-SPAssignment -Verbose:$false
try
{
# do your stuff
}
catch
{
write-output -ForegroundColor Red $_.ToString()
write-output -ForegroundColor Red $_.Exception.ToString()
}
finally
{
Stop-SPAssignment $gc -Verbose:$false
Release-PSSnapin
}
Thursday, July 9, 2015
Skeleton of basic powershell sharepoint file
Wednesday, July 8, 2015
App catalog site collection creation and association with web application using powershell SharePoint 2013
# Following command to create new app catalog sitecollection New-SPSite -Url http://XYZ:1440/sites/AppCatalog -OwnerAlias "XYZ\administrator" -Name “App Catalog site" -Template "APPCATALOG#0" Write-Output "Start associating app catalog sitecollection" $AppCatalogSitecollectionUrl "to" $WebApplicationUrl; Update-SPAppCatalogConfiguration -site $AppCatalogSitecollectionUrl -Force:$true -SkipWebTemplateChecking:$true; Write-Output "Association completed";
Thursday, July 14, 2011
SharePoint 2010 Prerequisite
Operating System:-
Developer can install it on window 7 & Vista 64 bit m/c.
Production server should be install in windows 2008 server SP2 or later 64 bit m/c. It can be install in window 2008 R2.
SQL Server Environment:-
* 64 bit SQL Server 2008 R2
* 64 bit SQL Server 2008 SP1
* 64 but SQL Server 2005 SP3
Prefer SqlServer 2008R2 to install.
IIS:-
IIS 7.0 is required.
Additional Component:-
SPS2010 works on .Net freamwork 3.5.
ADO.NET data services
Windows workflow foundation.
Windows Identity Foundation.
Hardware Requirment:-
WebServer,AppServer, Single Server:-
Processor:64 bit, four core
RAM: 4GB for developer or evaluation. 8GB for production.
DataBase Server:-
Processor:64 bit
RAM: 8GB small, 16 GB for production
hard disk: 80GB
Wednesday, January 19, 2011
Site Page Vs Application Page
Saturday, December 4, 2010
Tips SharePoint
1. When you write new functionality for SharePoint 2010, the only good and maintainable way to deploy such functionality is as a SharePoint solution. A solution is simply a .cab file, renamed to a .wsp file. if you quickly want to check what are the items inside solution just simply rename a .wsp file to a .cab file and open it, you will most definitely see all the items & a manifest.xml file in there. The manifest.xml file is what SharePoint would use to understand what the solution contains.
2. Web Part inherits from the System.Web.UI.WebControls.WebParts.WebPart, which is a class that was introduced in .NET framework 2.0. There is also another .WebPart base class in the Microsoft.SharePoint namespace, but that is there only for backward compatibility reasons with WSS 2.0. If you're writing a WebPart today, you shouldn't inherit from that class.
3. If your SharePoint powershell commands are not running, you may need to load the SharePoint powershell snap in first. You can do so by executing this command on powershell:
Add-PSSnapin Microsoft.SharePoint.Powershell
4. If you need to install SharePoint Designer 2007 and SharePoint Designer 2010 on the same machine both of them will need to be 32 bit only. You cannot have 64 bit office 2010 and SharePoint Designer 2007 on the same machine. Personally speaking, I virtualize my work, so this is never an issue for me anyway. In short you cannot have 64 bit Office 2010, 64 bit SharePoint Designer 2010, and SharePoint Designer 2007 on the same machine. You can have them side by side in 32 bit versions.
Diffrent ways to backup & restore in sharepoint
1. Backup & Restore Site Collection:-
This can be achieve from the sharepoint UI or from STSADM utility. For backup from sharepoint UI it can be done using central administration->operation->perform backup & for restore it can be done from central administration->operation->restore from backup. From STSADM following command can be used:-
To back up site collection, you may use the following command:
stsadm –o backup –url
Similarly, to restore a backed up file to a site collection, you may use the following command:
stsadm –o restore –url
2. Backup & Restore Site:-
For backup & restore of site following STSADM command can be used:-
To backup a single site, you may use the following command:
stsadm –o export –url
In order to restore a single site at any URl, you may use the following command:
stsadm –o import –url
3. Backup & Restore Web Site :-
SharePoint stores its data in content databases. A single website can have a number of content databases, and a content database can contain one or more site collections.You can view all the content databases associated with a given web application under central administration-> Application Management ->Content Databases. From this you can add or remove content databases to a given web site.
I hope this basic information will help you to perform back up & restore operation in sharepoint. Enjoyeeeeee :)