bool hasManagePermission = false;
SPSecurity.RunWithElevatedPrivileges(delegate()
{//how to check current user have a specific set of permission(s)
//eg. here we are checking the user have ManagePermissions
hasManagePermission = Web.DoesUserHavePermissions(SPBasePermissions.ManagePermissions);
});
27 April 2011
16 April 2011
Sending html tags to server
By encoding html by java script, we can send the html to the server with out setting ValidateRequest=”false”.
And in the server side we can just decode it.
And in the server side we can just decode it.
11 April 2011
Schedule item in sharepoint library 2010
Item scheduling is a special facility in sharepoint 2010 which help to publish a document for a specified period in a publishing site.
Item scheduling can be implemented only on libraries. Versioning need to be set for the library for this.Publishing server feature need to be activated for this
Create a new content type derived from the document content type, while creating this content type add the Scheduling start date, and Scheduling end date SharePoint inbuilt custom column in the content type along with the other columns required.
Use the custom content type in the library.
Once published the document will be in the schedule.
9 April 2011
Publishing Service Applications sharepoint 2010
Why?
Optimizing resources and reducing redundancy are two of the main reasons you would publish a service application.
Which Services can be published?
Only the cross fram services can be published.
Following are the cross farm services in sharepoint 2010
Business Data Connectivity,Managed Metadata,People (User Profiles),Search,Secure Store,Web Analytics
What need to be done?
For a farm to consume a service application that is published by another farm, the following actions must be performed in the following order.
Administrators of both the publishing and consuming farms must exchange trust certificates.
An administrator of the consuming farm must provide two trust certificates to the publishing farm: a root certificate and a security token service (STS) certificate.
An administrator of the publishing farm must provide a root certificate to the consuming farm.
To establish trust on the consuming farm, you must import the root certificate that was copied from the publisher farm and create a trusted root authority.
On the farm on which the application resides, an administrator must explicitly publish the service application.
An administrator must connect the consuming farm to the service application.
Steps
on consuming farm
1.Export the root certificate from the consuming farm
$rootCert = (Get-SPCertificateAuthority).RootCertificate
$rootCert.Export("Cert") | Set-Content <C:\ConsumingFarmRoot.cer> -Encoding byte
2.Export the STS certificate from the consuming farm
$stsCert = (Get-SPSecurityTokenServiceConfig).LocalLoginProvider.SigningCertificate
$stsCert.Export("Cert") | Set-Content <C:\ConsumingFarmSTS.cer> -Encoding byte
on publishing farm
3.Export the root certificate from the publishing farm
$rootCert = (Get-SPCertificateAuthority).RootCertificate
$rootCert.Export("Cert") | Set-Content <C:\PublishingFarmRoot.cer> -Encoding byte
4.Import the root certificate and create a trusted root authority on the consuming farm
$trustCert = Get-PfxCertificate <C:\PublishingFarmRoot.cer>
New-SPTrustedRootAuthority <PublishingFarm> -Certificate $trustCert
5.Import the root certificate and create a trusted root authority on the publishing farm
$trustCert = Get-PfxCertificate <C:\ConsumingFarmRoot.cer>
New-SPTrustedRootAuthority <ConsumingFarm> -Certificate $trustCert
6.Import the STS certificate and create a trusted service token issuer on the publishing farm
$stsCert = Get-PfxCertificate <c:\ConsumingFarmSTS.cer>
New-SPTrustedServiceTokenIssuer <ConsumingFarm> -Certificate $stsCert
General Security
To establish trust by using Central Administration
Security>General Security>Manage trust
On the Trust Relationship page, on the ribbon, click New.
On the Establish Trust Relationship page:
Supply a name that describes the purpose of the trust relationship.
Browse to and select the Root Authority Certificate for the trust relationship.
(This must be the Root Authority Certificate that was exported from the other farm by using Windows PowerShell.
If you are performing this task on the publishing farm, select the check box for Provide Trust Relationship.
Type in a descriptive name for the token issuer and browse to and select the STS certificate that was copied from the consuming farm.
Click OK.
After a trust relationship is established, you can modify the Token Issuer description or the certificates that are used by clicking the trust, and then clicking Edit. You can delete a trust by clicking it, and then clicking Delete.
Optimizing resources and reducing redundancy are two of the main reasons you would publish a service application.
Which Services can be published?
Only the cross fram services can be published.
Following are the cross farm services in sharepoint 2010
Business Data Connectivity,Managed Metadata,People (User Profiles),Search,Secure Store,Web Analytics
What need to be done?
For a farm to consume a service application that is published by another farm, the following actions must be performed in the following order.
Administrators of both the publishing and consuming farms must exchange trust certificates.
An administrator of the consuming farm must provide two trust certificates to the publishing farm: a root certificate and a security token service (STS) certificate.
An administrator of the publishing farm must provide a root certificate to the consuming farm.
To establish trust on the consuming farm, you must import the root certificate that was copied from the publisher farm and create a trusted root authority.
On the farm on which the application resides, an administrator must explicitly publish the service application.
An administrator must connect the consuming farm to the service application.
Steps
on consuming farm
1.Export the root certificate from the consuming farm
$rootCert = (Get-SPCertificateAuthority).RootCertificate
$rootCert.Export("Cert") | Set-Content <C:\ConsumingFarmRoot.cer> -Encoding byte
2.Export the STS certificate from the consuming farm
$stsCert = (Get-SPSecurityTokenServiceConfig).LocalLoginProvider.SigningCertificate
$stsCert.Export("Cert") | Set-Content <C:\ConsumingFarmSTS.cer> -Encoding byte
on publishing farm
3.Export the root certificate from the publishing farm
$rootCert = (Get-SPCertificateAuthority).RootCertificate
$rootCert.Export("Cert") | Set-Content <C:\PublishingFarmRoot.cer> -Encoding byte
4.Import the root certificate and create a trusted root authority on the consuming farm
$trustCert = Get-PfxCertificate <C:\PublishingFarmRoot.cer>
New-SPTrustedRootAuthority <PublishingFarm> -Certificate $trustCert
5.Import the root certificate and create a trusted root authority on the publishing farm
$trustCert = Get-PfxCertificate <C:\ConsumingFarmRoot.cer>
New-SPTrustedRootAuthority <ConsumingFarm> -Certificate $trustCert
6.Import the STS certificate and create a trusted service token issuer on the publishing farm
$stsCert = Get-PfxCertificate <c:\ConsumingFarmSTS.cer>
New-SPTrustedServiceTokenIssuer <ConsumingFarm> -Certificate $stsCert
General Security
To establish trust by using Central Administration
Security>General Security>Manage trust
On the Trust Relationship page, on the ribbon, click New.
On the Establish Trust Relationship page:
Supply a name that describes the purpose of the trust relationship.
Browse to and select the Root Authority Certificate for the trust relationship.
(This must be the Root Authority Certificate that was exported from the other farm by using Windows PowerShell.
If you are performing this task on the publishing farm, select the check box for Provide Trust Relationship.
Type in a descriptive name for the token issuer and browse to and select the STS certificate that was copied from the consuming farm.
Click OK.
After a trust relationship is established, you can modify the Token Issuer description or the certificates that are used by clicking the trust, and then clicking Edit. You can delete a trust by clicking it, and then clicking Delete.
21 March 2011
SharePoint 2010 Content Organizer
A mechanism to route the files based on the meta data provided on the base of rules set by rule managers.
This feature act like an Servant who can put the files in appropriate deck......
This feature act like an Servant who can put the files in appropriate deck......
20 March 2011
Content Type Syndication in SharePoint 2010
Content type syndication feature is amazing feature in share point 2010.This feature enable to centralized management and publication of content type. One of the scenarios where we can utilize this feature is when we need to maintain policies attached to the content types globally. In share point all the data structures are implemented as List and this lists are composed of content types. Content types are powerful data structures in share point where you can attached event receivers, work flows, policies etc.
Share point 2010 allows metadata management globally. For this one of the Site collection in the farm need to be act as the centralized location. This location is called content type hub in share point 2010 environment. Share point 2010 limits only one content type hub across the farm. Once the content type hub is set up, any number of content types in this hub can be a candidate for publishing. Once content type is published it can be accessed across the farm in any site collection, as they are globally available content types.
The settings for a content type hub can be initially done in the central admin using UI, however if we plan to change the content type hub we need to use power shell script for it. The content type publishing is carried out by timer jobs. So the scheduling of this timer jobs and their frequency are subject to be determined while planning the change propagation of the existing content type to its subscribers. A content type can re-publish any number of times for changes.
Content type syndication feature is very use full for implementing document retention policy across the farm. When workflow is attached to the content type which is candidate for publishing, And the target site have the same workflow. The workflow will be associated to the subscribed content type. But when a content type is published default no workflow associated with it is published. The only required thing is the required workflow to bring up in the subscribed site. The content type syndication will automatically take care of associating with the workflow in the subscribed site.
10 March 2011
Static Name and Name for List Columns
Static name will work with the list item , while Name works with after and before properties.
Subscribe to:
Posts (Atom)