Posts

Showing posts from 2014

SharePoint 2010 Role Assignment to Claims(Claim Based Authentication)

Claims Authentication: Claims Authentication is a new feature in SharePoint 2010 and understanding it will assist administrators in designing and maintaining robust infrastructures and help make implementing other functionality (such as PeoplePicker) a little easier.  It also provides many of the details related to setting up a trust configuration, an explanation of runtime considerations and management, configuration details, and programmatic implementations or the use of the extensibility points to turn federated access into a federated SharePoint Server 2010 business solution.  Claims: An identity provider makes claims about a user. A good example of an identity provider is Live ID. So Live ID will claim to have attributes and their values. For Example: Identity Provider "provider of the attributes" contains username attribute containing Himanshu. A custom identity provider created by a hacker also contains an account with username attribute named Himanshu. Both i...

Share Point 2010 Create Links List using Power Shell

Image
Links List in share point 2010 is list that contains links for reference with description means it stores urls along with details. For example If we need to store some data like Data1:             Url- www.google.com              Description- Here is a link for google Data2:             Url- www.blogger.com              Description- Here is a link for blogger clear Remove-PSSnapin Microsoft.SharePoint.Powershell -ErrorAction SilentlyContinue   Add-PSSnapin Microsoft.SharePoint.Powershell  function CreateandAdd-SPLinkListItems {     param($siteCollectionUrl, $listTitle, $itemDescription, $itemUrl)      $site =new-object Microsoft.SharePoint.SPSite($siteCollectionUrl)     $web = $site.OpenWeb("")          $list=$web.Lists.TryGetList($listTitle)      ...

Sharepoint 2010 Create External List using Powershell

SharePoint 2010 has introduced a new type of List called External List.  The External List is used for displaying content that comes from Business Connectivity Services (BCS) Enterprise content types.  Business Connectivity Services is the replacement in SharePoint 2010 for The Business Data Catalog (BDC) in SharePoint 2007.  External List needs External Content type for creating itself.  External Content Type is created using either SharePoint Designer 2010 or Visual Studio 2010.  Once the External Content Type is created, you can create the external list either from the Create page in SharePoint or via SharePoint Designer or Powershell.  Here is an example to create External List Using Powershell. clear   Remove-PSSnapin Microsoft.SharePoint.Powershell -ErrorAction SilentlyContinue   Add-PSSnapin Microsoft.SharePoint.Powershell $SiteUrl = " Site Url "   $BusinessListName = " BusinessList " $ConfigListName = "Config" $spweb = Get-SPWeb ...

Powershell How to Use Dictionary/Hash Table

Image
Dictionary/Hash Table is a "Key, Value" pair. It can make a list of key and value. So its very easy to relate which key belongs to which value. Below is the example of hash table. clear Remove-PSSnapin Microsoft.SharePoint.Powershell -ErrorAction SilentlyContinue Add-PSSnapin Microsoft.SharePoint.Powershell  $SiteUrl = "http://pps-dd-lite:9595/Sites/IPM" $LobSystemInstance = "IPM.BCS.ReferenceDataInstance" $EntityNamespace = "IPM.BCS.ReferenceData" $myHash = @{} $myHash[" Key_1 "] = " Value_1_ABC " $myHash[" Key_2 "] = " Value_2_DEF " $myHash[" Key_3 "] = " Value_3_GHI "  foreach($key in $($myHash.keys)) {  Write-Host "For key"  $key  " value is "  $myHash[$key] }   Result:

Sharepoint 2010 Create Custom Site Column and Add to Content Type using Powershell

Sometimes we need to add column to existing content type. For the same there are two ways. one is delete content type. If it has used some where else than first need to delete that target and after that delete this content type and create from scratch. So its a very long process.  Another way is create a site column first and add that column to content type(Using Powershell) as below. It will help you for sure. clear Remove-PSSnapin Microsoft.SharePoint.Powershell -ErrorAction SilentlyContinue Add-PSSnapin Microsoft.SharePoint.Powershell Function AddFieldToContentType($web, $ctype, $fieldName, $DisplayName) {     $ct = $web.ContentTypes[$ctype]     $fieldXMLString = '<Field Type="Text"     Name= "'+$fieldName+'"     DisplayName= "'+$DisplayName+'"     Group="IPM Document Group"     Required="FALSE"     ShowInDisplayForm="TRUE"     ShowInEditForm="TRUE"     ShowIn...

Sharepoint 2010 Grant Permission to a Group using Powershell

Sometimes we need to grant permission to a particular group. There are different different permission levels in sharepoint. Below are some examples: Full Control,  Design, Contribute, Read, View Only For allow group of user as per mentioned permission level here is a powershell script. I think this will be very helpful for grant permissions. clear   Remove-PSSnapin Microsoft.SharePoint.Powershell -ErrorAction SilentlyContinue   Add-PSSnapin Microsoft.SharePoint.Powershell  $Url = " Sitecollection/Site Url on which we need to grant permissions " $GroupName = " All Authenticated Users "   #Group Name $PermissionLevel = " Full Control "  # Permission Level $Description = " This group contains all authenticated users. "               $web = Get-SPWeb -Identity $Url if ($web.SiteGroups[$GroupName] -ne $null) { Write-Host "Group $GroupName already exists!" -foregroundcolor Red } else { $web...

Sharepoint 2010 Delete Multiple Site Collection and Databases using Powershell

Some times you need to delete multiple site collections or databases so if we delete them manually its a very time taking process so here is a power shell script that will help you definitely. clear Remove-PSSnapin Microsoft.SharePoint.Powershell -ErrorAction SilentlyContinue Add-PSSnapin Microsoft.SharePoint.Powershell ## Loading variables $WebApplicationURL = " Web Application Url " $tmpRoot = Get-SPWebApplication -Identity $WebApplicationURL $DataBaseInstanceToDelete =" Database1 , Database2 , Database3 , Database4 , Database5 "   ## Please Modify the array to delete Database instances $SiteCollectionsToDelete = " Site Collection Url1, Site Collection Url2, Site Collection Url3, Site Collection Url4, Site Collection Url5 "     ## Please Modify the array to delete Site Collections ## Getting all the databases related to web application $DataBaseInstance = Get-SPContentDatabase -WebApplication $WebApplicationURL ## Enume...