Search This Blog

Friday, October 24, 2014

Changes in BCS in SharePoint 2013

With every new version of SharePoint, Microsoft is improving the Business Connectivity space of the product. As with any product, expectations grow with progressive versions. New versions do not always fulfill the expectations. Here are a few things that are changing in SP 2013 from SP2010 and MOSS 2007:

SharePoint 2013
SharePoint 2010
MOSS 2007
BCS included in Office 13 apps
NA
NA
External Data sources can be:
  • Open Data (OData) (
    to get
    data from HTTP, ATOM, JSON etc)
  • Windows Communication Foundation (WCF) endpoints
  • Web services
  •  Cloud-based services
  • .NET assemblies
  • Custom connectors

External Data sources can be:
  • Windows Communication Foundation (WCF) endpoints
  • Web services
  • .NET assemblies
  • Custom connectors

External Data Sources can be:
  • Microsoft SQL Server
  • Web service

BDC Models for OData are created using Visual Studio only. BDC Models for the rest are through SPDesigner
BDC Models are defined through SPDesigner / Visual Studio
Manual definition of BDC Metadata XML file
Event listeners for External Data have been introduced.
This enables SharePoint users and custom code to receive notifications of events that occur in the external system.
Notifications not supported
Notifications not supported
Subscription based data retrieval from external systems is introduced.
The developers can target a particular entity in the external system, such as the Stock entity, and receive notifications about events that are published on that entity. This enables developers to write custom code for external lists that trigger SharePoint events when data is changed - e.g: alert an user, start a workflow
Subscriptions not supported
Subscriptions not supported
BDC models can be scoped to apps for SharePoint, with an option to store connection information in Secure Store, isolated from the model for manageability and security reasons
No concept of Apps
No concept of Apps
Managing the result set is now the responsibility of the external system e.g. Paging, filtering, and sorting of the external list data needs to be taken care by the source system before it is sent to SharePoint. The claim is that this would improve the performance of external lists
Filtering needs to be defined in the External Content Type definition
Sorting is done on the entire result set within SharePoint
Paging is managed in a roundabout way by using a filter
Methods, which contain the T-SQL or Web service methods that retrieve the entity data. Entities can contain multiple methods and can optionally have parameters and filters defined that Business Data Catalog users can use to filter results
By defining data source filter on BDC model, the filtering is expected to happen at source side
Filtering needs to be defined in the External Content Type definition
Filtering is to be specified in T-SQL / Web Service method parameters
Similar to filters, sorting can also be configured to happen at source by specifying in the BDC model. This sorting is expected to happen on the external source
Sorting needs to be managed in a roundabout way by using a filter

Sorting is to be specified in T-SQL / Web Service method parameters
External Lists can be exported to Excel with the following limitations:
  • Only the data that is
    displayed on the screen can be exported - which means only the chosen column, chosen view and the filtered (if any) items be exported
  • The link between Excel and the SharePoint list is unidirectional (from SP to Excel)
  • Whenever the data in Excel is refreshed, the latest data from SharePoint list is pushed to Excel, thereby over-writing any changes, as expected


No ability to Export to Excel, Create Visio Diagram, Open with Access or Open with Project
No ability to Export to Excel, Create Visio Diagram, Open with Access or Open with Project
External Data Sources for SharePoint online include the following:
  • WCF services
  • SQL Azure data services
  • OData endpoints
  • Web services

External Data Sources for SharePoint online supports only WCF connections
Not Supported
REST APIs for apps (web and mobile) as standard interface
No REST access through ListData.svc to External Lists
Not applicable
Business Connectivity Services Client Runtime supports simultaneous installation of Office 2010 and Office 2013 on the same client computer.
For example, if Outlook 2010 and Lync 2013 are installed on the same client computer, this new feature enables Office 2010 and Office 2013 to continue to work without breaking.
Not applicable
Not applicable

How to Increase Performance of Sharepoint

How to Increase Performance of Sharepoint in all levels.

Tune your Sharepoint with following tips.Here are the tips given by me to our project Artcore.
Today i m going to blog how to increase the performance of our sharepoint portal in all the levels.
Performance of an application using MOSS framework can be increased by enhancing in either one or in all of the following areas.
1.0 Infrastructure.
2.0 IIS.
3.0 SharePoint portal.
4.0 Application.
5.0 Code Level

1.0 Infrastructure
SharePoint is an application that works best when it gets lots of memory and CPU resources. SharePoint’s Web role uses stateless connections. Using this as advantage, if we install the Web role on several servers, it is possible to divide the client load between them. However, for this we need to consider and solve two challenges first. One is to make sure all web servers have access to the same information which is done by using a common back-end database for all of them. The second thing to solve is that all of these web servers must look like one single SharePoint server which is done by using (NLB). SharePoint supports up to eight servers running the web service role.
1.1 Index server
Different activities in SharePoint require different extent of resources; for example, displaying a project Site normally generates a very light load on the server, whereas indexing the database generates much higher load.

The Index service including the crawling activity is very resource intensive regarding CPU and disk access. By separating this service from the Web, many more users will be supported in the SharePoint environment. The indexing activity can be split between up to four different SharePoint servers.
Note: Only one Index server can crawl on a given content source. If one index server goes down, no other server will take over the indexing crawling that server is configured to do.

With below topology we can double the performance, availability….,

Picture to be placed here.

1.2 Calculating the Number of Operations per Second (OPS) required
For computation of the load or the OPS, on the SharePoint server, the following formula is used

(http://blogs.technet.com/wbaer/archive/2007/07/06/requests-per-second-required-for-sharepoint-products-and-technologies.aspx)


A*B*C*D /360,000*E= OPS
Where,
❑ A = The number of users.
❑ B = The percentage of active users on a typical day.
❑ C = The number of operations per active user per day.(1-10)
❑ D = The peak factor.(1-10)
❑ E = The number of working hours per day.

For ArtCore

A= ~ 1000
B= ~ 100
C=~10
D= ~10
E= 12

1000*100*10*10/360,000*12=10000000/4320000 = 2.31 OPS.

By Redesign we can manage up to 20,000-40,000 of users.

1.3 Requests per second
The general rule is to plan for 1 Rps. While a small server farm serves about 60 RPS for 1000 users, a medium farm with 2 WFE servers can serve about 120 Rps.

1.4 Disk Space Needed
When planning for the required disk space, there is no need to worry about the SPS binary files, because they are small compared to other files. More important are the index and database files. Regardless of the database type, you still need to follow this important rule:

You must always have at least 50 percent free space on your database disk!
The reason for this is that some database troubleshooting utilities need to make a copy of the database to perform their tasks. If you don’t have the required space, you may get into a situation where you cannot fix a problem.



2.0 IIS
2.1

When creating a Web Application (and associated site collection) that the default is that a unique IIS application pool be used for each. This can have several benefits – should some unexpected error in a site cause a problem it will be localized to that site collection, additionally the worker process will be caching content related to those specific sites. Worker process sizes between 250-300MB on X86 WFE servers, and between 400-500MB on X64 WFE servers. There are also other application pools and related IIS processes to support Central Administration, SSP, and so on, on the various WFE servers. The best-practice approach will be to consider which Web Applications should share an application pool, and which should be unique. Using multiple application pools can be beneficial, but it is easy to over-do by always taking the default settings (use new pool). Each related process has to load an instance of the .NET runtime in memory, so un-needed (excessive) application pools can waste memory.

2.2
IIS Compression
HTTP Compression is a wonderful technology that accomplishes a lot of different things. It allows faster page serving to clients and lower server costs due to lowered bandwidth (these two being enough for me to implement).

HTTP Compression is when a Web server receives a request for a file and instead of just serving the file to the client, it checks to see if the client browser (or application) is "Compression Enabled". If so, the Web server does a check on what type of file is being requested (this is determined by the file’s extension). If the file is marked as a static file, such as an HTML file, IIS will check the Compression Cache Temporary Directory.

If a compressed version isn’t found, IIS will send an uncompressed version of the file to the client and a compressed version is placed in the temporary directory (IIS will only serve to the client from the temp directory). If the compressed version is found, IIS will send the file directly to the requesting client. If the requested file is a dynamic file, such as an ASP.NET Web form, then the response is dynamically compressed and sent to the requesting client (no temp directory access is ever done).

By running the below scripts we can achieve compression
cscript.exe adsutil.vbs set W3Svc/Filters/Compression/GZIP/HcScriptFileExtensions "asp" "dll" "exe" "aspx" "asmx" "ashx"
cscript.exe adsutil.vbs set W3Svc/Filters/Compression/DEFLATE/HcScriptFileExtensions "asp" "dll" "exe" "aspx" "asmx"
cscript.exe adsutil.vbs set W3Svc/Filters/Compression/GZIP/HcDynamicCompressionLevel "9"
cscript.exe adsutil.vbs set W3Svc/Filters/Compression/DEFLATE/HcDynamicCompressionLevel "9"

(http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/d52ff289-94d3-4085-bc4e-24eb4f312e0e.mspx?mfr=true)
3. 0 SharePoint level
3.1 Caching
SharePoint provides two types of caching.

3.1.1 Page output caching
3.1.2 Disk caching

Disk-based cache scheme can be enabled on a per-site basis, and should be set consistently on each WFE server. In a typical site there are likely several references to image files (BMP, JPG, and so on) or to CSS style sheets or JS script files. These can be cached to avoid repeated database access for what are essentially static objects, and thus improve page response times. The cache is disabled by default, and is enabled by editing a line in the site WEB.CONFIG file found in the IIS Inetpub folder structure related to the site on the server’s system disk. Edit the file and search for the second instance of “BLOB” to get to the right line, which looks like:

Currently in production it is set to “false”.
The maxSize parameter is the maximum size of the disk cache in GB.
4.0 Application level
Our Project’s Key strength is InfoPath forms.
InfoPath Forms Services uses session state to store the large amount of transient data generated while filling out a form. As a result, front-end Web servers can remain stateless between round trips, and each post back is not burdened with carrying large amounts of session state information over narrow bandwidth pipes.

So if you are using infopath forms use formview state rather than session state.

5.0 Code Level
Many times we will delete or update list items in the lists by using Object oreiented code if these operations or doing on lists having bulk items then use
"ProcessBatchData" we can increase performance very much.

http://msdn.microsoft.com/en-us/library/cc404818.aspx

Advantages:
1) Performance
2) High availability(WFE & DB)
3) High Throughput
4) Scalability
5) No downtime 

Interview Questions asked by MNC companies

*********************************************************************************************************************

Search:
  1. What is the scope?
  2. How will you change the scheduling the scope?
  3. How will you configure search particular files like .pdf or .docx etc
  4. Sharepoint installed on server by default search is configured or not?
  5. How will you to configure search in particular webapplication?

Webpart:
  1. What is webpart?
  2. What is the difference between visual webpart and normal webpart?
  3. When your deployed the visual webpart what are 4 files going to deploy
  4. Tell me the steps to deploy the solution? other than powershell,stsdam tool is there any other way can we deploy the solution?
  5. With out restart the iis can we deploy any custom solutions (webpart)?
  6. What is the difference between sandbox solutions and form solutions?
Timerjob:
  1. What is the timerjob?
  2. How will you debug the timerjob?
  3. How can you deploy timerjob in multiple servers(sharepoint servers)?
Workflow:
  1. What are the new workflows and events in SP2013?
  2. When you will use sequentional workflow and when will you use statemachine workflows?
  3. How can we reopen existing sharepoint visual studio workflow using sharepoint designer?
  4. what is the difference between (2010,2013) spd workflows and vs workflows?
Event Receivers:
  1. What is the difference between event receiver and workflow?(steps and real time scenarios)
  2. Hierarchies of event receivers
General:
  1. What is feature?
  2. What is the scope?
  3. What is feature stapling?
  4. Any idea about installation sharepoint server and configuration?
  5. Some questions are real time scenarios

Accenture interview questions:


1)Tell me about your sharepoint experiences ?
2)Did you ever worked in Web Services ? How you called Webmethods ?
3)What type of Webparts you are developed in your current project ?
4)How many ways we can deploy the webpart ? Which is the best method to
   deploy the Webpart ?
5)What are new features in MOSS 2007 ?
6)What are the permission levels in Sharepoint ?
7)What is Sharepoint Object Model ?
8)What are basic building blocks for Sharepoint ?
9)How many types of Event Handlers in Sharepoint ? where did you use  
   these event handlers in your project ?
10)What are the Security levels in Sharepoint ?
11)What is the default authentication level in Sharepoint ?
12)Can we impliment Forms Authentication in Sharepoint or is there any 
     custom Authentication ?
13)What is meant by SignIn ?
14)What is meant by MetaData Cache ?
15)How can you impliment Data Fragment cache ? What is VaryByParam ?
16)When configuring Enterprise Search?

TCS questions:

1)Difference between WSS 2.0 , WSS 3.0 , MOSS 2007 ?
2)Difference between Windows Sharepoint Services and Portal Services ?
3)How to deploy and debug Webparts in Sharepoint ?
4)How can we apply Authentication in MOSS 2007 ?
5)How to use dataview webpart in Sharepoint Designer (SPD) 2007 ?
6)How to customize XSLT code in Dataview Webaprts using Sharepoint 
   Designer (SPD) 2007 ?
7)Which provider is better in Visual Studio ? like OLEDB and Sqlserver .
8)How to integrate Active directory user to public site(internet site)
9)Which Workflow are used in Sharepoint Designer , how can i executed 
   Workflow ? 
10)How can i get List of items in your site using API coding ? 
Value labs questions:

1)How to set forms authentication in your Sharepoint sites ?
2)What Content types used in MOSS 2007?
3)How to create new Templates in Sharepoint Server 2007 ?
4)What is Workflow ? default work flows in sharepoint server ?
5)How can i create new workflows in VS 2005 ? with real time example ?
6)What is Infopath template  ? how can i set browser configuration in 
   Infopath?
7)what is used for browser enabled infopath ?
   how can enable code in your infopath form ?
8)Differences between WSS 3.0 and MOSS 2007 ?
9)How to deploy Webparts in your Sharepoint by using SPD and VS ?
10)How to create Sharepoint solutions ? what is .cab file?
11)How can i set workflow history in sharepoint property ? 


Wipro questions:

1)What is the use of master page? Can you tell me , I want to put the 
   Drop-down control in master page, and this dropdown control should 
   populate the data from database?
2)How can you create and deploy the workflows by using Visualstudio 2005, 
   tell me the step-wise?
3)Can you tell me how to create the HRLeaveapproval workflow by using 
   SPDesinger?
4)What is the use of infopath forms? 
   I have the List called ”Employees”,in that there is a Field called ” 
   Department”, 
   I want to Fill the Department names in the infopathform control 
   (eg: Take the Dropdown control , i want to fill this Department names in 
          Dropdowncontrol )
5)10 users entering the data in infopath forms and submit the data, now i
   want to generate the reports for those 10 users, how can you do this?
6)What is the use of BDC ? 
7)How can you Configure the Enterprise Search?
8)What are the Base class methods you used in developing custom 
   Webparts ?
9)How many ways you can deploy the custom webparts ? with out install in 
   GAC, is there any other way to deploy ?
10)About Execl Services,
11)Feature event receivers Classes?
12)What is the use of “Run with elevated Previliages”?

Technics integration technologies interview questions:

1)What is Feature and its Deployment Types?
2)About WSP builder?
3)What is feature.xml and element.xml?
4)Write a program to enter the items in Sharepoint List?and How to add the  
   Users in your Current Site?
5)What is DDF? and About solution packages?
6)Event Handlers?
7)Search Configuration and Excel Services Configuration in MOSS 2007?
8)What about Service accounts?
9)What are the pillers of sharepoint?
10)Infopath forms?
11)How many ways to create workflows?Which is the best?
12)What is the Base Class of the Webpart? and About Content Edit
    Webparts?
13)About your Project details and roles & responsbilites?
14)What is the Sandbox Solutions?Why we are using that?
15)Migration from MOSS 2007 to Sharepoint 2010?How many types?Which one
    is the best?
16)Authentication Types in Sharepoint 2010?
17)What is  the Alternate Access Mapping?
18)Write a program to retraive the data from all lists in sharepoint?
19)What is the managed path?
20)Difference between Shared Service Provider and Shared Service Application?
21)How to publish the content type in Sharepoint 2010
22)What is the Managed meta data Service?
23)Difference between  list and Library?
24)How to move the list from one site to another site?
25)How to move the data from Development server to Production server?
26)What is the Runwith Elivated Privilliages?
27)Error handling or coding in infopath?
28)How to access the LINQ in Sharepoint 2010?
29)How to deploy Silverlight Webparts?
30)Issues on Migration and How to solve that?

Igate questions:

1)What are the picture Libraries?
2)How can upload multiple pictures?
3)Difference between Sp 2007 ans Sp 2010?
4)How can Configure the SSP in SP 2010?
5)What are the Webservices?
6)Difference beetween form library and document library?
7)Write code to fetch the users in list?
8)Admin Repoting Kit(ARK)?
9)Blob Caching?
10)Search Services in moss 2007 and Sp 2010?

Logica questions:

1)What is the Webpart Development and Deployment in Sharepoint
   2007/2010? How to do Step by Step?
2)What is the Site Definitation? How to do?
3)What is Feature and Feature Stappling?
4)How to generate the WSP in Moss 2007?
5)Difference between Site Definition and Site Template?
6)What is the meaning of Ghosting and Unghosting in Sharepoint?
7)What is the Extend Web Application?When your creating the extend Web
   application,it will store the same database or create any  new database?
8)How to deploy SilverLight Web part in Sharepoint 2010?
9)What is Powershell?Comparision between Stsadm and Powershelll?Which
   one is better?
10)What is IFS(Infopath Form Service).How to publish the Forms to Sharepoint 
    site?
11)Site Pages and Application Pages?
12)Sharepoint Programming.
13)Sharepoint 2010 Architecture.

INTERVIEW QUESTIONS in real time:

1)Tell me the sharepoint execution process?
2) What is the necessary file in modifying the masterpage?
3) What is content type? and what is the use?
4) How many content types in sharepoint?
5) How to modify column name in custom list?
6) what are the webpart's u developed?
7) what is the advantages of sharepoint designer?
8) How to build webpart? what is the necessary file we want?
9) What is wsp? How to create .wsp file? what we want to build wsp file?
10)how to use master page in sharepoint?
11)How can u deploy the webpart to sharepoint gallery?
    Sub question : ( I don’t want to put the assembly in GAC i want that is as  
    a private assembly )
    Why it s necessary to mention that is a safecontrol ? 
12)How to crate & place themes in Share point sites?
13)How can u call the custom CSS in Share point?
14)How many types of permissions in Share point?
15)How to change the default date format (mm/dd/yyyy) to jan-01-2008?
16)Explain BDC? Why to go for BDC?
17)In how many ways backup and restore the SharePoint site?
18)What is Audience targeting?
19)Can u write the code to copy the existing list to another list?
20)What is the use of STSADM tool?
21)How to create & delete list using object data model?
22)Did u create any workflows in ur project ? what are the workflows u created 
    (and either by using sharepoint designer or visual studio)
23)Difference between Sequential workflow and state machine Workflow ?
24)How do u debug the workflows ( how do u handle exceptions) ?
25)Can we generate the strong name key to private assembiles ?
26)How can u deploy the webpart to sharepoint gallery?
    Sub question : ( I don’t want to put the assembly in GAC i want that is as 

                           a private assembly )
27)Why it s necessary to mention that is a safecontrol ?

 Pennywise Solutions

1. what is masterpage ? use of materpage..?

2.  what is meant by sitetemplate ? how can u create a site template?

3. Wat is meant by work flow ? how can u create a workflow on lists and libraries

4. Wat is meant by webpart ? how can u deploy the webpart ? h’w many ways we deploy the webpart

5. did u use any contenteditor webpart in ur project..?

6. Wat is meant by features, uses of features ? did u create any features in ur project..?

7. did u create any event handlers ? on which events u rised those event handlers…?

8. Wat is sharepoint solution file..?

9. did u write any BDC in ur project..?

10. did u configure enterprise search crawl settings ? how ?

11. what is sharepoint object model ..?

12. diff betwen intranetsite extranet site and internet sites

13.  h’w can u create a cutsomtemplates..?

14. what is the use of infopath forms…? did u use any datasource in infopath forms..?

15. what is meant by Farm ?

16. Wat is SPweb , spsite, sitecollection..?

17. Wat is meant by SSP..?

18. what is sitedefinition ? how can we deploy..?

19. can we customise default webparts…..? h’w ..?


20. What is the typical development environment for share point?

21.  How do you move code from Development t production? Is any custom tool
used?

22.  How do you connect external data from MS SQL or SAP to sharepoint?

23. Say about the architecture of sharepoint?

24. Some questions from content management such us how wil u design policy
pages and about your past projects?

25. How will you integrate an existing ASP.Net application or Java
application with sharepoint?

26. Say about document collaboration and workflows in sharepoint?

27. Say about Event Handlers in Sharepoint?

28.How will u deploy a webpart in sharepoint?

29. Wat is an infopath form and how to connect to external data sources from
it?

30. HOw will you change the layout of a site?Is there any tool to achive it?

31.  How will access the Sharepoint Object Model?

32. How will import data from external Data source to Sharepoint thru BDC?

33. How will back up restore sites?

Tuesday, October 21, 2014

SharePoint 2010 Windows PowerShell Interview Questions

Q. What is Windows Powershell ?
Ans. Windows PowerShell is a new Windows command-line shell designed especially for system administrators. In the SharePoint administration context, Windows PowerShell is another administration tool that supersedes the existing Stsadm.exe.


Q. How is Windows Powershell different from Stsadm ?
Ans. Unlike stsadm, which accept and return text, Windows PowerShell is built on the Microsoft .NET Framework and accepts and returns .NET Framework objects. In addition to that it also gives you access to the file system on the computer so that you can access registry,digital signature certificate etc..


Q. What are cmdlet's?
Ans. Windows PowerShell introduces the concept of a cmdlet which are simple build in commands, written in a .net language like C# or VB.


Q. Can you Create PowerShell scripts for deploying components in SharePoint ?
Ans. If you are creating a webpart with VS 2010 then you can deploy it using ctrl + f5. However, to activate the webpart feature you can write a powershell script (.ps1) and execute it after dpeloyment.


Q. Where is Powershell located in sharePoint ?
Ans. On the Start menu, click All Programs -> Click Microsoft SharePoint 2010 Products -> Click SharePoint 2010 Management Shell.


Q. If you need going to install a webpart or any custom solution in SharePoint 2010 using PowerShell What permissions do you need?
Ans. In order to use Windows PowerShell for SharePoint 2010 Products, a user must be a member of the SharePoint_Shell_Access role on the configuration and content database. In addition to this, the user must also be a member of the WSS_ADMIN_WPG local group on the computer where SharePoint 2010 Products is installed. See  The Details below


Permissions for Windows PowerShell - SPShellAdmin


In order to use Windows PowerShell for SharePoint 2010 Products, a user must be a member of the SharePoint_Shell_Access role on the configuration and content database. In addition to this, the user must also be a member of the WSS_ADMIN_WPG local group on the computer where SharePoint 2010 Products is installed.


To add a user as SharePoint_Shell_Access on the SharePoint database use the below powershell cmdlet :
Add-SPShellAdmin


Please Note that to run the above cmdlet you must have* Membership in the securityadmin fixed server role on the SQL Server instance
* Membership in the db_owner fixed database role on all affected databases
* and local administrative permission on the local computer.



In addition to above some important things to Note:


* The user gets added to the WSS_Admin_WPG group on all Web servers when the user is added to the SharePoint_Shell_Access role.
* If the target database does not have a SharePoint_Shell_Access role, the role is automatically created.
* If you use the database parameter, the user is added to the role on the farm configuration database, the Central Administration content database, and the specified database. Using the database parameter is the preferred method because most of the administrative operations require access to the Central Administration content database. The cmdlet is something like below :


Add-SPShellAdmin -UserName Domainname\User -database {Database GUID}


Q. How to list all the commands in PowerShell ?
Ans. Get-Command * commands gets you all the Powershell commands. For more commands see 
To Open the Windows PowerShell Session :


1. On the Start menu, click All Programs.
2. Click Microsoft SharePoint 2010 Products.
3. Click SharePoint 2010 Management Shell


Note : You should have SharePoint_Shell_Access role on the configuration database and you should be a member of the WSS_ADMIN_WPG local group on the computer where SharePoint Server 2010 is installed.


Some of the Common Commands and Operations are: 


Create Web Application Variable 
$webapp = Get-SPWebApplication "http://pravahaminfol234/"


Create SharePoint Site Variable (Instance of SPSite)
$siteurl = "http://mysharepointsite/"
$Oursite=new-object Microsoft.SharePoint.SPSite($siteurl)
Here we have created a variable Oursite, which contains an instance of type SPSite. Now you can use it to Display all webs in the site collection.
$Oursite.AllWebs more // List all Webs in the Site


Create Service Application Variable
$spapp = Get-SPServiceApplication -Name "ServiceApplicationDisplayName"


Create a Webapplication: 
New -SPWebApplication -ApplicationPoolName -Name [ -Port ] [-HostHeader ] [-URL ][ -ApplicationPoolAccount ]


Delete WebApplication 
Remove-SPWebApplication –identity -URL <http://sitename/> -Confirm


Create\Delete a Site Collection: 
Create a Site collection:
Get-SPWebTemplate
$template = Get-SPWebTemplate "STS#0"
New-SPSite –Url "" –OwnerAlias "" –Template $template
Here $template is a Variable to store the type of template we want to use while creating a site collection.


Delete a Site Collection:
Remove-SPSite –Identity –GradualDelete
Here is a site Collection Url .


Back\Restore a content database
To Backup : 
Backup -SPFarm -Directory -BackupMethod -Item [-Verbose]
Backup folder - is a folder to save your backup.
BackupMethod – Can Specify between Full or Differential.


To Restore: 
Restore -SPFarm -Directory -RestoreMethod Overwrite -Item [-BackupId] [-Verbose]
If you don’t know the BackupID you can display all the backups using the below command and get the GUID of the Backup.
Get-SPBackupHistory -Directory 
You can check all the Backup-Restore Operations Here


Deploy WebPart Soluiton Package
Install -SPWebPartPack -LiteralPath "PathToCABorwspFile" -Name "NameOFWebPart"
PathToCABorwspFile- is the full path to the CAB file that is being deployed.
NameOFWebPart- is the name of the Web Part that is being deployed.


Install Activate and Deactivate Feature using Windows Powershell 
Install Feature :
$MyFeatureId = $(Get -SPFeature -limit all where {$_.displayname -eq "myfeatureName"}).Id
Install -SPFeature $MyFeatureId


Activate\Enable Feature :
$singleSiteCollection = Get -SPSite -Identity http://mysinglesitecollectionurl/
Enable -SPFeature $MyFeatureId -Url $singleSiteCollection.URL


Deactivate\Disable Feature :
$singleSiteCollection = Get-SPSite -Identity http://mysinglesitecollectionurl/
Disable -SPFeature $MyFeatureId -Url $singleSiteCollection.URL


Command TO List all the PowerShell Commands 
Get-Command –PSSnapin “Get-Command –PSSnapin “Microsoft.SharePoint.PowerShell” format-table name > C:\SP2010_PowerShell_Commands.txt


Adding a content database using PowerShell in SharePoint 2010
To attach an existing content database:
Mount-SPContentDatabase "" –DatabaseServer "" –WebApplication http://webapplicationname/
is the content database to be attached.
is the name of the database server.
http://webapplicationname/ is the name of the Web application to which the content database is being attached.
To detach a content database:
Dismount-SPContentDatabase ""
Where is the name of the content database.


SharePoint 2010 Windows PowerShell Commands - II 
Some more PowerShell Commands
Site Collection Commands


Create Site Collection :
Get-SPWebTemplate
$template = Get-SPWebTemplate "STS#0"
New-SPSite -Url "" -OwnerAlias "" -Template $template


Delete Site Collection :
Remove-SPSite -Identity "URL of site Collection" -GradualDelete


Change Site collection Quotas :
Set-SPSite -Identity "SiteCollection Url" -MaxSize Quota


Add site Collection Administrators :
Set-SPSite -Identity "" -SecondaryOwnerAlias ""


Lock or unlock a site collection :
Set-SPSite -Identity "Site Collection Url" -LockState ""
is one of the following vales :
# Unlock: To unlock the site collection and make it available to users.
# NoAdditions: To prevent users from adding new content to the site collection. Updates and deletions are still allowed.
# ReadOnly: To prevent users from adding, updating, or deleting content.
# NoAccess: To prevent access to content completely. Users who attempt to access the site receive an access-denied message.
Create a site :
New-SPSite "http://sitecollection/sites/Subsite -OwnerAlias "DOMAIN\UserName" –Language 1033