1. Authentications:
Authentication and Authorization in Share Point
B. App authentication
C. Server-to-server authentication
A. User authentication:
SharePoint 2013 supports two authentication types for user authentication:
These five are not different from each other. They use the same Web Application and same content, which is stored in the Application with the same database.
Multiple lines execute at a time.
after it will run functionality based keywords done, when, promises
Instatiate objects
get_current,get_web
Commit batch
currentxt.executequeryAynsc(onsuccses, onfailre)
Ans: New “SPField.JSLink” property has been added to help specify any external JavaScript file Containing any Rendering logic for Out-of-Box or Custom field type.With JSLink developers can now Control the Rendering (the presentation and validation) of any Field (Custom or Out-of-box) on List forms as well as in Views by simply adding a reference to an External or deployed JavaScript file.
12. New SPSecurityEventReceiver?
Ans: In SharePoint 2013, MS has added “SPSecurityEventReceiver” class to handle events for SharePoint Groups, Users, Roles and Permission Inheritance.For list of events that you can handle see
13,. “Digital Content types”?
Ans: In SharePoint 2013 Microsoft has introduced a new set of content types called “Digital Asset Content Types” for better use of Audio, Video and Images as Web Content.These content types can be added to any library and can be used as a one of the items files.
14. “Related Items” Column?
Ans: A new Column type “Related Items” has been Introduced in SharePoint 2013 where you can add reference to another Item or a document from any List\Library as a related entity to one of the Item using Related Items column.
71) What are Catalogs?
Allow you to incorporate lists into your publishing sites.
72) At a high level, what is cross-site publishing?
Enables you to reuse content across multiple site collections.
all pages share the same look and feel
Each site has a Master pages Gallery
13. InfoPath forms Development
14. Power Shell
14. Web Services
15. BCS
16. Nintex Workflow
17. SharePoint Designer workflow
18. Diff between Nintex Workflow and Designer workflow
19. Server Object model
20. Diff between Server object model and Client object model
1. CAML is always better than LINQ because if you write LINQ query then finally it converts in CAML internally so it down the performance.
2. Of course there is other advantages of LINQ like: Sorting/filtering/can return objects /
3. Most imp part, it is object oriented etc.
SPSecurity.RunWithElevatedPrivileges(
Metadata:
1. Managed Metadata is a hierarchical collection of terms that can be associated with items in SharePoint 2010.
2. We can use Central Administration website to manage these terms.
Sandbox solution vs Form solution
Sandboxed Solution:
- Sandboxed solutions are hosted in the SharePoint user code solution worker process (SPUCWorkerProcess.exe).
- The process runs under a CAS policy that restricts programmatic access to any resource outside the sandbox.
- Never restart the IIS application pool.
- If you run any code it will affect only the site collection of the solution.
- Helpful if you have shared hosting.
- When the Sandboxed Solution property is set to True, selecting Build\Deploy Solution deploys the solution to the site collection Solution Gallery.
1.we can't create Aplication pages in Sandbox solutions.
2.Beacuse Application pages are stored in the 14\TEMPLATES\_LAYOUTS and when we deploy as sandbox we dont have permissions to the physical folder.
3.We cant use code to connect to the external web services or to database in the sandbox soltion
4.runwithelevatedprivileges doesn't work
5.Site collection adminstrator can deploy a Sandboxed solutions,
Application page and Site Pages:
Site Pages:
1.To create a new page, click Site Actions, then select New Page.
2. After naming the page, a blank content area appears.
Master pages and page layouts dictate the overall look and feel of your SharePoint site.
SharePoint 2010's Content Query Web Part(cqwp):
SPSiteDataQuery
GHOSTING AND UNGHOSTING IN SHAREPOINT 2010
Ghosting:
Basically any file which is not stored in content database, stored in file system.is known as ghosted file.
ex: default.masterpage
UnGhosting:
files are stored in content database not in file system is as called unghosted files.
Application Pages : Normal asp.Net pages stored on file system.
site pages : Normal content pages stored in db.
What is Impersonation?
Authentication and Authorization in Share Point
Authentication is process of challenging and approving user’s Identity, while Authorization comes after the authentication, where user based permissions, rights, and privileges are taken into account.
A. User authenticationB. App authentication
C. Server-to-server authentication
A. User authentication:
SharePoint 2013 supports two authentication types for user authentication:
- Claims-based authentication
- Windows classic mode authentication
Claims-based authentication:-
The following describes how claims-based authentication works:
- The user requests to access the application or service.
- The application or service sends a request to the STS for a token for that user.
- The STS authenticates the user (for example, via a password or smart card or biometric scan).
- The STS generates the token.
- The STS digitally signs the token and the digital signature becomes part of the token.
- The STS returns the token to the application or service that requested it.
- The application verifies that the digital signature is valid and that it came from an STS that the application trusts (each application will have a list of trusted STSs).
- The application processes the claims information to determine whether to allow the user to access the service or application and what level of access the user will have.
Windows classic mode authentication:-
Classic mode authentication only supports Windows Authentication, you cannot use forms-based or SAML-based authentication with classic mode.
It uses the Windows user account to directly authenticate the user to access SharePoint resources.
* Inside SharePoint: You have to use HTML and Ja vaScript, and authentication is already taken care for you.
* In the cloud: You have two choices:
Use client-side code along with the cross-domain library.
User server-side code along with OAuth.
*REST APIs
* In the cloud: You have two choices:
Use client-side code along with the cross-domain library.
User server-side code along with OAuth.
*REST APIs
Delegate controls:
"Its a Pointer to Function / Method", in this case, Delegate Control is a pointer to a Control which can be replaced at runtime based on Feature Activation or Deactivation.
Zones:-
Zones are of Five types:
- Internet
- Intranet
- Extranet
- Custom
- Default
The difference is
- The main difference is each zone carries its own IIS Website after extending it from SharePoint. These zones have their own URLs configured for them.
- These zones have their own Port number, Protocol (http or https).
- Different authentication methods can be used to login in the different zones.
E.g:- Forms authentication in Intranet, default Windows authentication etc. - You configure your Blob and Distributed cache differently for the different zones.
Adding Extranet Users in SharePointOpen Central Administration site - Application Management - [under Application Security] Policy for Web Application - Add Users-Zone: Extranet-NEXT-Type User Name [click on the icon below it to check]-Permission: Full Control-Finish.
2. JSOM
what is jsom?
code executes in browser
No authentication - browser context only
requires sharepoint context
use in Hosted apps
JSOM required libraries
.microsftajax.js
sp.runtim.js
sp.js
context.executeQueryAsync:code executes in browser
No authentication - browser context only
requires sharepoint context
use in Hosted apps
JSOM required libraries
.microsftajax.js
sp.runtim.js
sp.js
Multiple lines execute at a time.
after it will run functionality based keywords done, when, promises
Exception handling in JSOM
startScope
startTry
startCatch
startFinally
startScope
startTry
startCatch
startFinally
Reading data
key objects
web,lists,listitem
web,lists,listitem
Instatiate objects
get_current,get_web
Commit batch
currentxt.executequeryAynsc(onsuccses, onfailre)
Create sharepoint constructs
LisitemCreationInformation
ListCreationInformation
GroupCreationInformation
FieldlinkCreationInfomation
ContentTypeCreationInformation
Navigation..
Roeldefinition
UserCreation
ViewCreation
WebCreation
ListCreationInformation
GroupCreationInformation
FieldlinkCreationInfomation
ContentTypeCreationInformation
Navigation..
Roeldefinition
UserCreation
ViewCreation
WebCreation
3. Rest API
introduced in 2010
enhanced in 2013
SharePoint rest does not implement the full OData specification
we are using API service
we will attempt the Resource Path
Endpoints
site - /_api/site
web- /_api/web
user profile - /_api/SP.UserProfiels.PeopleManager
Search - /_api/publishing
results:
call
_api/web/lists - result type = collection access via = data.d.result[index];
_api/web/lists/GetByTitle("list1")/item(1) - result type = single access via= data.d
_api/web/lists/GetByTitle("list1")/item - result type = coleciton access via = data.d.result[index];
introduced in 2010
enhanced in 2013
SharePoint rest does not implement the full OData specification
we are using API service
we will attempt the Resource Path
Endpoints
site - /_api/site
web- /_api/web
user profile - /_api/SP.UserProfiels.PeopleManager
Search - /_api/publishing
results:
call
_api/web/lists - result type = collection access via = data.d.result[index];
_api/web/lists/GetByTitle("list1")/item(1) - result type = single access via= data.d
_api/web/lists/GetByTitle("list1")/item - result type = coleciton access via = data.d.result[index];
32) What request type from a REST resource allows one to create a SharePoint object?
POST request.
33) What request type from a REST resource allows one to access the contents of a file ?
GET request.
34) What request type from a REST resource allows one update the contents of a file?
PUT request.
35) What request type from a REST resource allows one to delete a SharePoint object?
POST to that resource including an X-Http-Method header of DELETE.
36) What are HTML ETags?
The SharePoint REST service uses HTML ETags for concurrency control.
37) What are ETags useful for?
When you perform a PUT, PATCH, MERGE, or DELETE request, you can specify an ETag in the If-Match HTTP request header.
4. Angular JS
5. JavaScript
6. JQuery
7. Apps
Types
SharePoint hosted app:
jsom only...
SharePoint hosted app:
jsom only...
not the .net mangaed code
Provider hosted apps
csom an rest api
cannot server object model
Disadvantages:
Microsoft office developer tools for visual studio we can download and install it to visual studio.
host web vs app web
once the app is install or placed on page this is called host web
csom an rest api
cannot server object model
Disadvantages:
- SharePoint site or iis network could be in somewhere in network or somewhere in the cloud.
- SharePoint 2013 has introduced the App
- In sp2015 this has been renames Add-Ins from Apps
Microsoft office developer tools for visual studio we can download and install it to visual studio.
host web vs app web
once the app is install or placed on page this is called host web
once hosted the host web
The Code for an app runs in different places, depending on where your app is hosted. They never run in the context of SharePoint Server, but they will run in the context of the browser or in the context of the hosted platform. You Can Develop three kind of Apps –
- SharePoint-hosted apps
- Provider-hosted and auto hosted apps – In the cloud
- Apps that have a mix of Components in SharePoint and in the cloud
8. Whats are the new Delegate Controls in SharePoint 2013?
Ans: In SharePoint 2013, three New Delegate Controls have been Introduced for the purpose of displaying the new Top Suite bar (with links SkyDrive, NewsFeed,Sync,follow). These Controls are –
Ans: In SharePoint 2013, three New Delegate Controls have been Introduced for the purpose of displaying the new Top Suite bar (with links SkyDrive, NewsFeed,Sync,follow). These Controls are –
- SuiteBarBrandingDelegate delegate Control
- SuiteLinksDelegate delegate Control
- PromotedActions Delegate Control
Callout Popups: when ever you mouse over specific control popup will be show.
Microsoft has added a new Callout Popup framework to Create Hover Popups that you know as Preview Windows as well.
What specific features Improve Performance in SharePoint 2013? Kindly elaborate.
SharePoint 2013 introduces following features that improves performance significantly.
- Distributed Cache Service
- Minimal Download Strategy and
- Shredded Storage by introducing Shredded BLOBs.
What is a Theme?
Themes are used to apply customization to a SharePoint Site and applying a lightweight branding by changing overall site layout, colors, fonts, background image etc.
What are remote event receivers?
Remote event receivers handle events that occur to an item in the app, such as a list, a list item, or a web.
What is the Design Manager?
The Design Manager enables a step-by-step approach for creating design assets that you can use to brand sites.
What is the Snippet Gallery?
Allows a user to select a component, configure its properties and update the snippet, copy the HTML snippet that’s generated, and paste that HTML snippet into your HTML file.
7. App creation on SharePoint 2013
What as an App in its most basic form?
A web application that is registered with SharePoint using an app manifest
What is an app manifest?
An app manifest is an XML file that declares the basic properties of the app along with where the app will run and what to do when the app is started.
5) Where can the code for an app run?
SharePoint-hosted apps, Provider-hosted and auto hosted apps, Apps that have a mix of components in SharePoint and in the cloud
6) How does an app communicate with SharePoint?
- REST and JavaScript APIs
- Managed APIs (.NET)
7) How can the app authenticate to SharePoint?
- Inside SharePoint
- In the cloud
8) How are apps distributed?
Apps for SharePoint are distributed as an app package.
9) What are some options for app publishing?
- Public SharePoint app store
- Organization’s app catalog
10) What is OData?
The Open Data protocol (OData) lets you access a data source, such as a database, by browsing to a specially constructed URL.
11) What is the primary benefit of OData?
Simplified approach for connecting to and working with data sources that are hosted within an organization.
12) What technologies does OData use?
- HTTP
- Atom
- JavaScript Object Notation (JSON)
19) What are the three types of authorization policies?
user-only policy, user + app policy, or app-only policy
8. App creation on Office 365
24) What are some of the features of Office 365 Development Tools?
Create and manage projects, develop apps, share and publish apps.
9. Bootstrap
10. JS Link
What’s the new “SPField.JSLink” property used for?Ans: New “SPField.JSLink” property has been added to help specify any external JavaScript file Containing any Rendering logic for Out-of-Box or Custom field type.With JSLink developers can now Control the Rendering (the presentation and validation) of any Field (Custom or Out-of-box) on List forms as well as in Views by simply adding a reference to an External or deployed JavaScript file.
12. New SPSecurityEventReceiver?
Ans: In SharePoint 2013, MS has added “SPSecurityEventReceiver” class to handle events for SharePoint Groups, Users, Roles and Permission Inheritance.For list of events that you can handle see
13,. “Digital Content types”?
Ans: In SharePoint 2013 Microsoft has introduced a new set of content types called “Digital Asset Content Types” for better use of Audio, Video and Images as Web Content.These content types can be added to any library and can be used as a one of the items files.
14. “Related Items” Column?
Ans: A new Column type “Related Items” has been Introduced in SharePoint 2013 where you can add reference to another Item or a document from any List\Library as a related entity to one of the Item using Related Items column.
Q22: What Changes are Introduced in SharePoint 2013 Publishing
Ans: SharePoint Server 2013 has two ways that you can make published Content available to users: author-in-place and cross-site publishing.
Author-in-place – When users use a single site collection to author content and make it available to readers
Cross-site collection publishing –
Ans: SharePoint Server 2013 has two ways that you can make published Content available to users: author-in-place and cross-site publishing.
Author-in-place – When users use a single site collection to author content and make it available to readers
Cross-site collection publishing –
Q23: What is Cross-Site Publishing?
Ans: Cross-Site Publishing is a new Feature in SharePoint Server 2013 that enables you to reuse content across site collections,web applications, and farms.You can use cross-site publishing to Create branded Internet, intranet and extranet publishing sites.
Allow you to incorporate lists into your publishing sites.
72) At a high level, what is cross-site publishing?
Enables you to reuse content across multiple site collections.
Why should a Company Migrate to SharePoint 2013?
Ans: Microsoft has added some Incredible features to SharePoint 2013 that can be of huge benefit to all the Companies that use SharePoint on a large scale. Most of the new Features are Introduced for Improving SharePoint Performance (for both Browser and SQL) and to enhance the famous Web Content Management Capabilities.There is an Improvement for all – end users, developers and IT administrators.
Ans: Microsoft has added some Incredible features to SharePoint 2013 that can be of huge benefit to all the Companies that use SharePoint on a large scale. Most of the new Features are Introduced for Improving SharePoint Performance (for both Browser and SQL) and to enhance the famous Web Content Management Capabilities.There is an Improvement for all – end users, developers and IT administrators.
How does SharePoint 2013 Improve Performance?
Ans: SharePoint 2013 Introduces Minimal Download Strategy and Distributed Cache Service to Improve Page Load; and Shredded Storage to Improve Storage required for saving files.
Ans: SharePoint 2013 Introduces Minimal Download Strategy and Distributed Cache Service to Improve Page Load; and Shredded Storage to Improve Storage required for saving files.
Q6: What is Distributed Cache Service?
Ans:The Distributed Cache service provides caching features in SharePoint Server 2013. The microblog features and feeds rely on the Distributed Cache to store data for very fast retrieval across all entities. The Distributed Cache service is built on Windows Server AppFabric, which implements the AppFabric Caching service. Windows Server AppFabric installs with the prerequisites for SharePoint Server 2013.
Q6: What is Shredded Storage?
Ans: With Shredded Storage feature enabled, every document and the Changes made to the document, is stored in SQL as multiple “Shredded BLOBS“. Whenever a new Version of a document is Created, only the BLOBs of the document that Corresponds to the Change are saved as opposed to the entire document as a new version.This feature helps to lower down the amount of storage required for saving files.
Ans: With Shredded Storage feature enabled, every document and the Changes made to the document, is stored in SQL as multiple “Shredded BLOBS“. Whenever a new Version of a document is Created, only the BLOBs of the document that Corresponds to the Change are saved as opposed to the entire document as a new version.This feature helps to lower down the amount of storage required for saving files.
11.Content Editor Web part & Script Editor Web part
12. SharePoint Designer
all pages share the same look and feel
html page layout defined by common master page
page formatting defined by common cs files
client side behaviors defined by JavaScript files
page formatting defined by common cs files
client side behaviors defined by JavaScript files
Pages within site can split into two categories
.Site pages exists within the content DB for a site
.Application pages only exist on file system of wfe
.Site pages exists within the content DB for a site
.Application pages only exist on file system of wfe
Site pages
they may or may not be ghosted(customized)
they support customization via web parts
they support customization via SharePoint designer
they may or may not be ghosted(customized)
they support customization via web parts
they support customization via SharePoint designer
Application pages deployed on web server
it is in-ghosted
.server up out of _layout directory
they do not support customization or web parts
they are parsed/compiled as classic ASPNET pages
they cannot be edited or seen in SharePoint designer
it is in-ghosted
.server up out of _layout directory
they do not support customization or web parts
they are parsed/compiled as classic ASPNET pages
they cannot be edited or seen in SharePoint designer
Each site has a Master pages Gallery
.V4.master used for page layout in SharePoint 2010
.minimal. Master used in a few sites (eg. search center)
. Default. Master used to create for migrated 2007
.minimal. Master used in a few sites (eg. search center)
. Default. Master used to create for migrated 2007
Create Page-layout Using SharePoint Designer
We can create page layout in SharePoint designer 2010 very easily. First open your site inSharePoint designer 2010 and then from the Site Objects section from the left side click on Page Layouts as shown in the figure below.
Then from the ribbon click on New Page Layout as shown in the figure below:
Then from the New Page Layout Dialog box Select the content type group, content type name, url name, title as shown in the figure below, then click on OK.
This will create your pagelaout, now to add web part zones or to add different sections modify as below.
<%@ Page language="C#" Inherits="Microsoft.SharePoint.Publishing.PublishingLayoutPage,Microsoft.SharePoint.Publishing,Version=14.0.0.0,Culture=neutral,PublicKeyToken=71e9bce111e9429c" meta:progid="SharePoint.WebPartPage.Document" meta:webpartpageexpansion="full" %>
<%@ Register Tagprefix="SharePointWebControls" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register Tagprefix="PublishingWebControls" Namespace="Microsoft.SharePoint.Publishing.WebControls" Assembly="Microsoft.SharePoint.Publishing, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register Tagprefix="PublishingNavigation" Namespace="Microsoft.SharePoint.Publishing.Navigation" Assembly="Microsoft.SharePoint.Publishing, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<asp:Content ContentPlaceholderID="PlaceHolderPageTitle" runat="server">
<SharePointWebControls:FieldValue id="PageTitle" FieldName="Title" runat="server"/>
</asp:Content>
<asp:Content ContentPlaceholderID="PlaceHolderMain" runat="server">
<table>
<tr>
<td><WebPartPages:WebPartZone id="MyTopZone" runat="server" title="TopZone"><ZoneTemplate></ZoneTemplate></WebPartPages:WebPartZone>
</td>
</tr>
<tr><td>
<WebPartPages:WebPartZone id="MyMiddleZone" runat="server" title="MiddleZone"><ZoneTemplate></ZoneTemplate></WebPartPages:WebPartZone>
</td></tr>
<tr><td>
<WebPartPages:WebPartZone id="MyLeftZoneFirst" runat="server" title="LeftZoneFirst"><ZoneTemplate></ZoneTemplate></WebPartPages:WebPartZone>
</td>
<td>
<WebPartPages:WebPartZone id="MyLeftZoneMiddle" runat="server" title="LeftZoneMiddle"><ZoneTemplate></ZoneTemplate></WebPartPages:WebPartZone>
</td>
<td>
<WebPartPages:WebPartZone id="MyLeftZoneRight" runat="server" title="LeftZoneRight"><ZoneTemplate></ZoneTemplate></WebPartPages:WebPartZone>
</td>
</tr>
</table>
</asp:Content>
Here I have added 3 sections, top, middle and lower. And my top and middle section contains one web part zone and my lower section contains 3 web part zone.
Then you can publish the page layout by right click on the page layout and click on Checkin. And your name page will look like below image
Then from the ribbon click on New Page Layout as shown in the figure below:
Then from the New Page Layout Dialog box Select the content type group, content type name, url name, title as shown in the figure below, then click on OK.
This will create your pagelaout, now to add web part zones or to add different sections modify as below.
<%@ Page language="C#" Inherits="Microsoft.SharePoint.Publishing.PublishingLayoutPage,Microsoft.SharePoint.Publishing,Version=14.0.0.0,Culture=neutral,PublicKeyToken=71e9bce111e9429c" meta:progid="SharePoint.WebPartPage.Document" meta:webpartpageexpansion="full" %>
<%@ Register Tagprefix="SharePointWebControls" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register Tagprefix="PublishingWebControls" Namespace="Microsoft.SharePoint.Publishing.WebControls" Assembly="Microsoft.SharePoint.Publishing, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register Tagprefix="PublishingNavigation" Namespace="Microsoft.SharePoint.Publishing.Navigation" Assembly="Microsoft.SharePoint.Publishing, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<asp:Content ContentPlaceholderID="PlaceHolderPageTitle" runat="server">
<SharePointWebControls:FieldValue id="PageTitle" FieldName="Title" runat="server"/>
</asp:Content>
<asp:Content ContentPlaceholderID="PlaceHolderMain" runat="server">
<table>
<tr>
<td><WebPartPages:WebPartZone id="MyTopZone" runat="server" title="TopZone"><ZoneTemplate></ZoneTemplate></WebPartPages:WebPartZone>
</td>
</tr>
<tr><td>
<WebPartPages:WebPartZone id="MyMiddleZone" runat="server" title="MiddleZone"><ZoneTemplate></ZoneTemplate></WebPartPages:WebPartZone>
</td></tr>
<tr><td>
<WebPartPages:WebPartZone id="MyLeftZoneFirst" runat="server" title="LeftZoneFirst"><ZoneTemplate></ZoneTemplate></WebPartPages:WebPartZone>
</td>
<td>
<WebPartPages:WebPartZone id="MyLeftZoneMiddle" runat="server" title="LeftZoneMiddle"><ZoneTemplate></ZoneTemplate></WebPartPages:WebPartZone>
</td>
<td>
<WebPartPages:WebPartZone id="MyLeftZoneRight" runat="server" title="LeftZoneRight"><ZoneTemplate></ZoneTemplate></WebPartPages:WebPartZone>
</td>
</tr>
</table>
</asp:Content>
Here I have added 3 sections, top, middle and lower. And my top and middle section contains one web part zone and my lower section contains 3 web part zone.
Then you can publish the page layout by right click on the page layout and click on Checkin. And your name page will look like below image
13. InfoPath forms Development
14. Power Shell
PowerShell:
Windows PowerShell is an Extendable command shell and scripting language.
Pre-PowerShell we used to do all sorts of tasks with all sorts of tools:
Central Administration website
the SharePoint Products Configuration Wizard
STSADM
Psconfig
Use with Stsadm->
Activate / deactivate the feature
Delete / add the feature
Backup/restore
Administrator full access to applicable application programming interfaces (APIs). Administrators can use Windows PowerShell to interact directly with SharePoint-based web applications, site collections, sites, lists, and more.
14. Web Services
15. BCS
Business Connectivity Services is a centralized
infrastructure in SharePoint 2013 and Office 2013 that supports integrated data
solutions.
External
Content Types in BCS
External content types are the core of BCS. They enable you to
manage and reuse the metadata and behaviors of a business entity, such as
Customer or Order, from a central location. They enable users to interact with
that external data and process it in a more meaningful way.
harePoint’s Business
Connectivity Service (BCS) is intended to provide SharePoint access to a
variety of data sources to include:
- SQL Server
- .NET
- WCF Service
- SOAP
- REST Service Connection
- XML File Connection
Key Points about BCS:
- BCS Definitions are based on ‘operations’, Create, Read Item, Read List, Update and Delete
- BCS allows you to work directly with data stored in an external system or database
- Authentication can be done directly using User authentication or the SharePoint Secured Store Service can be used to authenticate with a specific account
- Information can be one-way (view only) or two-way (add, update & delete)
- BCS data sources can be ‘associated’ to one another to create ‘relationships’ – One-to-Many, One-to-One, etc.
- BCS Connections can be made using SharePoint Designer (easiest) or through Visual Studio
- BCS ‘definitions’ can be exported and imported across sites
- BCS is based on the “Business Data Catalog” and uses BDC definitions to access “line of business” (LOB) data.
- WCF provides the most flexibility and control of data and is best when multiple data sources must be combined to create the desired view
16. Nintex Workflow
17. SharePoint Designer workflow
18. Diff between Nintex Workflow and Designer workflow
19. Server Object model
20. Diff between Server object model and Client object model
21. Feature
Feature:
Feature Scopes
Features are Packages of functionality ,That you can activated and deactivated in a SharePoint Farm.
They have four Possible scopes:A SharePoint Feature is a Functional component that can be used for activated and deactivated at various scopes throughout a SharePoint instances, scope of which are defined as
They have four Possible scopes:A SharePoint Feature is a Functional component that can be used for activated and deactivated at various scopes throughout a SharePoint instances, scope of which are defined as
Feature Scopes
FARM - Activate Feature for an entire server farm. -> is something that affects the whole farm,
Example: For example provisioning a custom timer job or deploying a BCS model.
Example: For example provisioning a custom timer job or deploying a BCS model.
WEB APPLICATION - Activate Feature for all websites in a web application.-> only affects a single web application,
Example: Activate Feature that modifies the web.config file.
Example: Activate Feature that modifies the web.config file.
SITE - Activate Feature for all websites in a site collection. only affects a site collection
Example: an example being the deployment of a master page to the master pages catalogue.
WEB - Activate Feature for a Specific website.
Example: instance setting the default master page for that site.
Example: instance setting the default master page for that site.
21. CAML
CAML:.
CAML - Collaborative Application Markup Language
Ø XML- Extensible Markup Language based query language
Ø Used to perform a query operation against SharePoint Lists
CAML stands for Collaborative Application Markup Language. CAML is XML based language which provides data constructs that build up the SharePoint fields, view, and is used for table definition during site provisioning
2. Of course there is other advantages of LINQ like: Sorting/filtering/can return objects /
3. Most imp part, it is object oriented etc.
Disadvantages of using Linq: 1. During the run time the LINQ query itself gets converted into a CAML query, which is an extra step ahead that takes more time . This can be avoided if we write a CAML query itself straight away.
2. Also, we generate a DataContext class using the SPMetal.exe. This class is the one which we use in our project to generate LINQ queries. This class is not generated dynamically. So, if we do any changes in any of the lists or libraries in our site it is not reflected in the DataContext class. We have to generate a new class whenever we make any changes in the site.
3. Unlike CAML queries, LINQ to SharePoint has no use if we are going to access SharePoint data in Silverlight using Client Object Model.
4. Fields like Created, CreatedBy, Modified and ModifiedBy of a SharePoint list are not created by SPMetal to be used in the LINQ queries.
5. LINQ to SharePoint cannot be implemented for an External list.
21. Search and Crawling
Search:-
SharePoint 2010 provides a site template that's built for delivering search results. You can use this template to create a branded search experience or to customize how results appear. You can choose among three search center site templates:
Basic Search Center delivers a stripped down search experience in one page. This site template uses Web Part pages and is essentially a team site specialized for search.
Enterprise Search Center provides multiple pages for displaying search results. This site template uses publishing pages, which make it easier to brand and customize than Basic Search Center.
FAST Search Center is used with the add-on search product FAST Search for SharePoint 2010 to provide enhanced search results. Very large enterprises use the FAST search product. Any search solutions you create with SharePoint 2010’s default search options continue to work even if your company chooses to deploy FAST.
21. Timer Job
22. Event receivers
Event Receivers: If you want to catch some action in SharePoint and want to do something on each action, then you can use event receivers’. Event receivers are nothing but classes.
Sometimes they are called before events and after events.
Types also includes :
1) Item-Level Event Receivers
2) List-Level Event Receivers,
3)Web-Level Event Receivers,
4)Workflow Event Receivers
1) Item-Level Event Receivers
2) List-Level Event Receivers,
3)Web-Level Event Receivers,
4)Workflow Event Receivers
23. item level permissions
24. RunWithElevatedPrivileges
- Create a delegate method that will run with elevated permissions
- We will wrap this new delegate method with the SPSecurity.RunWithElevatedPrivileges() block
- Which will in turn execute the specified method with Full Control rights even if the user does not otherwise have Full Control
- Provide a simple example of how to implement this in your solution such as an event receiver.
SPSecurity.RunWithElevatedPrivileges(
delegate
()
{
// Everything executed here will be executed under the AppPool account and will have full permissions.. so becareful!!
using
(SPSite site =
new
SPSite(properties.SiteId))
{
using
(SPWeb web = site.OpenWeb(properties.Web.ID))
{
SPList list = web.Lists[properties.ListId];
SPListItem listItem = list.Items.GetItemById(properties.ListItemId);
SPFile file = listItem.File;
file.MoveTo(newURL);
}
}
});
25. Site Definition and Site Template
Site definition:
1. Site definition is installed on file system of web front ends.
2. Located at..\14\Templates\Site Templates.
3. Site definition consists of .aspx pages and .xml files with Collaborative Application Markup Language (CAML).
4. Major Benifit is that the page and List definition is read locally from the File System, not from Content Database.
Site definition vs Site template:
Files are on disk, better performance.
|
Files are in database, less efficient.
|
Highly customizable and extensible (XML and .NET code is much more flexible than UI)
|
Not easily extensible (You are limited by what UI offers)
|
Can provision multiple webs *
|
Can only provision one web
|
Complex to create
|
Easier to create
|
Requires admin access to server for deploying.
|
Installable from a Web UI by site owners.
|
Modifying the site definition after provisioning at least one site from it is not supported and might break existing sites.
|
Custom templates can be modified without affecting existing sites that have been created from the templates (**).
|
Site definitoin
A site definition is the basic blueprint for a site.
-> site definition consists of .aspx pages and .xml files with Collaborative Application Mark-up Language (CAML).
-> major benefit is that the Page and List definition is read locally from the file system, not from Content Database.
A site definition in Sharepoint consists of two parts
ONET.xml: Contains the bulk of the actual site definition
WEBTEMP.xml: it contains This is a collection of templates which are defined by ONET.xml files.
26. Document set
How to create document set in SharePoint 2010
Document Set is used to manage set of documents as a single object
It is a new feature introduced in Share Point 2010.
Advantages of using Document Set in Share Point 2010.
Work Flow can be associated to a whole document set.
We can upload project related documents in Document set.
We can maintain the version of all related documents using Document set.
We can manage permissions easily.
We can able to set customizable welcome page for Document Set.
We can download all the zip files easily by using Document Set.
There is no limit that no of documents exit in Document set.
Folders also used to manage set of documents as a single object.
But for folders we can't start work flow.
Customizable welcome page for all document sets.
Now I will Explain How to Create Document Set.
27. Drop Off Library
SharePoint 2010 introduced a new feature called Content Organizer. This article will introduce how documents flow through the Content Organizer and how users can create and manage rules.
1. Content Organizer is a site level feature. Navigate to Site Actions => Site Settings => Site Actions =>Manage site features.
2. Activate the feature Content Organizer.
3. Once this feature is activated, you will see two options, Content Organizer Settings and Content Organizer Rules, under the Site Administration section
4. A new document library called Drop Off Library will also be created in the location you will be adding documents to.
These documents will be moved to the target library based on Content Organizer rules.
5. A new content type will be created for Content Organizer rule as follows:
6. Let’s look at the Content Organizer rules.
First navigate to Site Actions => Site Settings => Site Administration =>Content Organizer Rules.
Enter a name for your rule. In my example I call my rule “Example rule”.
In the Submission’s Content Type section select the Content type: Group andType.
7. In the Conditions section, set the Property- based condition for the rule and select the Target location where you want to save the document based on the rules conditions.
8. Click the OK button and a new rule will be created successfully.
9. Now let’s see if it works. Add a document to the Drop Off Library and enter the title Example rule, or the title that you created.
10. If the rules condition is met, in my example “Title is equal to Example rule”, then a message will pop up as follows:
11. The document will be saved in Shared Documents.
12. If the condition is not met:
13. Then a similar message will pop up as follows:
14. But the document will be added to the Drop Off Library and NOT added to theShared Documents library.
1. Content Organizer is a site level feature. Navigate to Site Actions => Site Settings => Site Actions =>Manage site features.
2. Activate the feature Content Organizer.
3. Once this feature is activated, you will see two options, Content Organizer Settings and Content Organizer Rules, under the Site Administration section
4. A new document library called Drop Off Library will also be created in the location you will be adding documents to.
These documents will be moved to the target library based on Content Organizer rules.
5. A new content type will be created for Content Organizer rule as follows:
6. Let’s look at the Content Organizer rules.
First navigate to Site Actions => Site Settings => Site Administration =>Content Organizer Rules.
Enter a name for your rule. In my example I call my rule “Example rule”.
In the Submission’s Content Type section select the Content type: Group andType.
7. In the Conditions section, set the Property- based condition for the rule and select the Target location where you want to save the document based on the rules conditions.
8. Click the OK button and a new rule will be created successfully.
9. Now let’s see if it works. Add a document to the Drop Off Library and enter the title Example rule, or the title that you created.
10. If the rules condition is met, in my example “Title is equal to Example rule”, then a message will pop up as follows:
11. The document will be saved in Shared Documents.
12. If the condition is not met:
13. Then a similar message will pop up as follows:
14. But the document will be added to the Drop Off Library and NOT added to theShared Documents library.
Metadata:
1.
2. We can use Central Administration website to manage these terms.
This is a new feature in SharePoint 2010.
Example: You have a document library to upload articles. For each item you can specify a column metadata of category like C#, ASP.NET etc.
- Term: A term is keyword that can be associated with a SharePoint item.
- Term Set: A term set is a group of terms. You can restrict that a particular item should contain a term from a particular term set. For example: setting the category of an article item from term set [C#, ASP.NET].
- Local Term Sets: Site collection scoped term set. Only site user can see it.
- Global Term Sets: Global Term Set created outside the site collection. They are visible to all users.
http://www.codeproject.com/Tips/401716/SharePoint-2010-Managed-Metadata-Configuration-and
Farm Solutions: The scope of farm level solution is farm level so it has Full trusted access to all resources and functionality of SharePoint.
Sandbox solution vs Form solution
In SharePoint 2010 we can have two types of solutions one is Sandboxed Solution and Farm Solution while developing a solution in Visual Studio 2010.
One major difference in the deployment is Farm solutions are installed and deployed. Sandboxed solutions are uploaded and activated.
One major difference in the deployment is Farm solutions are installed and deployed. Sandboxed solutions are uploaded and activated.
Farm Solutions:
- Farm solutions are hosted in the IIS worker process (W3WP.exe).
- If you run any code in farm solution the whole farm will got affected.
- If you deploy any feature or retract any feature the whole application pool got recycled.
- Since they are scoped as farm level, they have full trust access to all the resources.
- When the Sandboxed Solution property is set to False, selecting Build\Deploy will deploy the solution to the Farm Solution Gallery.
- Farm solutions are hosted in the IIS worker process (W3WP.exe).
- If you run any code in farm solution the whole farm will got affected.
- If you deploy any feature or retract any feature the whole application pool got recycled.
- Since they are scoped as farm level, they have full trust access to all the resources.
- When the Sandboxed Solution property is set to False, selecting Build\Deploy will deploy the solution to the Farm Solution Gallery.
Sandboxed Solution:
- Sandboxed solutions are hosted in the SharePoint user code solution worker process (SPUCWorkerProcess.exe).
- The process runs under a CAS policy that restricts programmatic access to any resource outside the sandbox.
- Never restart the IIS application pool.
- If you run any code it will affect only the site collection of the solution.
- Helpful if you have shared hosting.
- When the Sandboxed Solution property is set to True, selecting Build\Deploy Solution deploys the solution to the site collection Solution Gallery.
we create use with sandbox:
list definition
list instances
webparts
event receivers
Feature receivers
Designer workflows
infopath busines logics
2.Beacuse Application pages are stored in the 14\TEMPLATES\_LAYOUTS and when we deploy as sandbox we dont have permissions to the physical folder.
3.We cant use code to connect to the external web services or to database in the sandbox soltion
4.runwithelevatedprivileges doesn't work
5.Site collection adminstrator can deploy a Sandboxed solutions,
Templates: Site template, Web template, Library template, List template
Custom Templates:
These templates can be located at C:\Program Files\Common Files\Microsoft Shared\web server extensions\15\TEMPLATE\1033.
->Advantages of having custom templates.
->You can control the Look and feel of the web site page.
->You can have your predefined custom web parts.
->Not required to drag and drop web parts.
->Same look and feel across the web site page.
Httphandler: Every request into an ASP.NET application is handled by a specialized component known as an HTTP handler. The HTTP handler is the most important ingredient while handling ASP.NET requests
In use with sharepoint you need to deploy your code to in the GAC.
ASP.NET default handlers:
Page Handler (.aspx) - Handles Web pages
User Control Handler (.ascx) - Handles Web user control pages
Web Service Handler (.asmx) - Handles Web service pages
Trace Handler (trace.axd) - Handles trace functionality
Using SharePoint 2010, the HTTP handler was deployed to the LAYOUTS folder. The trick here is that SharePoint needs to load all its referenced assemblies from the GAC and in this case the assembly was in the GAC but we were not referencing the FQDN of the assembly.
Webpartzones:
Web Parts located in a Web Part zone When a Web Part is located inside a Web Part zone, the Web Part properties are stored in the content database in Windows SharePoint Services 3.0, not in the ASPX page. By inserting a Web Part inside a zone, you make it possible for users to interact with or modify that Web Part through the browser.
Web Parts not located in a Web Part zone When a Web Part is not located inside a Web Part zone, the Web Part properties are stored in the ASPX page and not in the content database in Windows SharePoint Services 3.0. By inserting a Web Part without enclosing it in a zone,
Application page and Site Pages:
Application page: Application pages are shared across all sites on the server, whereas a site page is specific to one site.
To create an application page, add an Application Page item to a SharePoint project. When you create an application page, Visual Studio adds the following folders to your project:
-> Application page is an ASP.NET content page present LAYOUTs directory
“C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS “
a. . An application page can have code behind as well as inline code
b. . An application page doesn’t support web parts or web part zones
c. . Application page is available to all the sites,
d. . Application page must deployed only in farm solution,
Site Pages:
1. Site Pages are stored in the virtual file system in the Content databases
2. Site page can’t have code behind or inline code.
3. Site Pages supports web parts
4. Site page can be deployed only specific sites
5. Site Page can be deployed using a sandbox solution
6. Site pages can be deployed by site collection administrators/end-users.
1.To create a new page, click Site Actions, then select New Page.
2. After naming the page, a blank content area appears.
Choose your page layout by selecting it from the drop-down list under Text Layout. Formatted text , different styles , tabs ...etc.
3. Site Pages are have not webpart zones.
Master page:
-> Page layouts contains is a field controls and Web Parts
-> Page layouts contains is a field controls and Web Parts
Master pages and page layouts dictate the overall look and feel of your SharePoint site
->you can quickly change the appearance of an entire site.
->This article shows you how to create and modify a copy of the existing primary master page and then apply the new or modified master page to all of the pages in your site that are attached to the primary master.
->you can quickly change the appearance of an entire site.
->This article shows you how to create and modify a copy of the existing primary master page and then apply the new or modified master page to all of the pages in your site that are attached to the primary master.
Master pages contain controls that are shared across multiple page layouts, such as navigation, search, or language-preference for multilingual sites.
->Master pages and content pages work together using a set of replaceable regions, or content placeholder controls
-> inside content placeholders in your SharePoint 2010 page layout. Although you can place text and HTML markup inside placeholders, most often you put fields, controls, containers, and Web Parts in your page layout.
Here are multiple control types that you can put in a page layout to contain content:
Web Parts/Web Part zones:
HTML controls:
ASP.NET controls:
sharepoint controls
dataview controls
Content controls:
content fields
Page-layouts:
->Master pages and content pages work together using a set of replaceable regions, or content placeholder controls
-> inside content placeholders in your SharePoint 2010 page layout. Although you can place text and HTML markup inside placeholders, most often you put fields, controls, containers, and Web Parts in your page layout.
Here are multiple control types that you can put in a page layout to contain content:
Web Parts/Web Part zones:
HTML controls:
ASP.NET controls:
sharepoint controls
dataview controls
Content controls:
content fields
Page-layouts:
Master pages and page layouts dictate the overall look and feel of your SharePoint site.
Master pages contain controls that are shared across multiple page layouts, such as navigation, search, or language-preference for multilingual sites. Page layouts contain field controls and Web Parts
By using master pages, you can provide a consistent look and feel for your site. You can use master pages to position items that must be shared by all pages, such as navigational controls, company logos, and copyright notices. Within master pages, you can use user controls (.ascx controls), Web server controls, and Web Parts.
v4.masterpage:
V4Materpage in a one of the primary page in masterpage.
->Team Site home page, list and library pages, and site settings page.
->Used for content and administration pages. Provides the interface and layout for SharePoint 2010.
Minimal master page:
The home and search results pages on a Search Center, pages that host Word or Excel web applications.
Contains minimal SharePoint content, used for full-screen functionality or embedded applications.
What is solution:
Ans. Solutions are the container packages for Features. Solution basically, is a cabinet (.cab) file with extension .wsp which contains various components needed to be deployed (features, web parts, custom forms etc) along with files that describe some important metadata about those Components. Once a Solution is installed on a server in the farm, you can deploy it to any web application from your Solution Management
Ans. Solutions are the container packages for Features. Solution basically, is a cabinet (.cab) file with extension .wsp which contains various components needed to be deployed (features, web parts, custom forms etc) along with files that describe some important metadata about those Components. Once a Solution is installed on a server in the farm, you can deploy it to any web application from your Solution Management
Security levels in SharePoint:
Full Control: Enables users to have full control of the website.
Design: Enables users to view, add, update, delete, approve, and customize items or pages in the website.
Contribute: Enables users to manage personal views, edit items and user information, delete versions in existing lists and
document libraries, and add, remove, and update personal Web Parts.
Edit: Enables users to manage lists.
Read: Enables users to view pages and list items, and to download documents.
View only: Enables users to view application pages. The View Only permission level is used for the Excel Services Viewers group.
Limited Access: Enables users to access shared resources and a specific list, document library, folder, list item, or document.
If you use a site template other than the team site template, you will see a different list of default SharePoint permission levels. For example,
1. Approve 2. Manage Hierarchy 3. Restricted Read
If you use a site template other than the team site template, you will see a different list of default SharePoint permission levels. For example,
1. Approve 2. Manage Hierarchy 3. Restricted Read
Limited Access cannot be edited or deleted.
Special Permissions
- Site level Controls access to the site and any objects that inherit their permissions from the site.
- List or library level Controls access to the list and all folder and items in the list that inherit their permissions from the list.
- Folder level Controls access to the folder itself and any items in that folder that inherit their permissions from the folder.
- Item level or document level Controls access to a specific list item or a document.
Where are Master Pages and Layout Pages located in a SharePoint site?
They are location in master Page(Master Page Gallery) under _catalogs folder of root site.
- See more at: http://sharepointknowledgebase.blogspot.in/2012/12/sharepoint-developer-interview-questions.html#sthash.UgUlZkFD.dpuf
2010 vs 2013
Developement changes
Socail and collaboration Fetures
Search
Enterprise Content Mangement
Server object model , Client object model , silverlight and javascript..
interview Questions for Developers - A four-part series.
Managed Object Model
|
Microsoft.SharePoint .Client.dll
Microsoft.SharePoint .ClientRuntime.dll
|
ISAPI folder
|
Silverlight client object model
|
Microsoft.SharePoint .Client.Silverlight.dll
Microsoft.SharePoint .Client.Silverlight.Runtime.dll
|
LAYOUTS\ClientBin folder
|
JavaScript client object model
|
SP.js
|
LAYOUTS folder
|
Different types of Objects:
Server object model
|
Managed Model
|
Silverlight Model
|
Javascript Model
|
SPContext
|
ClientContext
|
ClientContext
|
ClientContext
|
SPSite
|
Site
|
Site
|
Site
|
SPWeb
|
Web
|
Web
|
Web
|
SPList
|
List
|
List
|
List
|
SPListItem
|
ListItem
|
ListItem
|
ListItem
|
SPField
|
Field
|
Field
|
Field
|
SandBox Solutions support the following SharePoint item types:
- List definitions
- List instances
- Content Types/Fields
- Navigation
- Web Parts derived from WebPart
- Event receivers
- Custom Workflow Actions
- Doesn’t Supported
- programmatic workflow
- Event receivers
o SPLimitedWebPartManager
- timer jobs
- visual WebParts
- SharePoint mapped folders (e.g. "_layouts", and "images")
SharePoint 2010's Content Query Web Part(cqwp):
1. Content Query Web Part(cqwp) contains we can get items list items , library documents , content types from different sites and sub-sites Or Entire site-collection
2. we can configure to filtering , audience targeting
3.If u want create cqwp
First you need to activate Fetures is "SharePoint server publishing infrastructure"
4. After then u can get the cqwp in webpart gallary
2. we can configure to filtering , audience targeting
3.If u want create cqwp
First you need to activate Fetures is "SharePoint server publishing infrastructure"
4. After then u can get the cqwp in webpart gallary
SPSiteDataQuery
SPSiteDataQuery is used to retrieve data from list or from all list in the site collection ( used for cross-site and cross-list queries).
SPSiteDataQuery.Webs property will be used to specify from where the data will be retrieved.
Example Syntax:
Mysite= SPContext.Current.Web.Url;
using
(SPSite site =
new
SPSite(
Mysite
))
{
using
(SPWeb web = site.RootWeb)
{
SPSiteDataQuery dataQuery =
new
SPSiteDataQuery();
dataQuery.Webs =
"<Webs Scope=\"Recursive\">"
;
dataQuery.Lists =
"<Lists ServerTemplate=\"101\" />"
;
dataQuery.ViewFields =
"<FieldRef Name=\"DocumentNo\"/>"
+
"<FieldRef Name=\"Title\" />"
+
"<FieldRef Name=\"Tags\" />"
+
"<FieldRef Name=\"FileRef\" />"
;
string
where
=
""
;
where
=
"<Where>"
;
if
(txtDocumentNo.Text !=
""
)
{
where
+=
"<Eq>"
;
where
+=
"<FieldRef Name=\"DocumentNo\"/>"
;
where
+=
"<Value Type='Text'>"
+ txtDocumentNo.Text +
"</Value>"
;
where
+=
"</Eq>"
;
}
where
+=
"</Where>"
;
dataQuery.Query =
where
;
DataTable dt = web.GetSiteData(dataQuery);
DataView dv =
new
DataView(dt);
gvResult.DataSource = dv;
gvResult.DataBind();
}
Customer code for SPDataQuery
GHOSTING AND UNGHOSTING IN SHAREPOINT 2010
Ghosting:
Basically any file which is not stored in content database, stored in file system.is known as ghosted file.
ex: default.masterpage
UnGhosting:
files are stored in content database not in file system is as called unghosted files.
Application Pages : Normal asp.Net pages stored on file system.
site pages : Normal content pages stored in db.
What is Impersonation?
Impersonation is the security feature that enables to control the Identity under which code is executed. Impersonation gives the following advantages:
- Run a high privilege code through a low privilege user
- Record changes in account of another user
Example code:
//we just need to get a handle to the site for us
//to get the system account user token
SPSite tempSite =
new
SPSite(siteStr);
SPUserToken systoken = tempSite.SystemAccount.UserToken;
using
(SPSite site =
new
SPSite(siteStr, systoken))
{
using
(SPWeb web = site.OpenWeb())
{
//right now, logged in as Site System Account
Console.WriteLine(
"Currently logged in as: "
+
web.CurrentUser.ToString());
//add your code here
}
}
No comments:
Post a Comment