Thursday, May 23, 2013

Remove providername of FBA user name in sharepoint 2010


#[void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")
#Add-PSSnapin Microsoft.SharePoint.Powershell -ErrorAction SilentlyContinue
#add-pssnapin Microsoft.SharePoint.Powershell

<#
  Users.csv has list of all user names.

UserName
Suryap
Ravik
Johnp

#>

Copy below code and save it as .ps1 file. Open PowerShell window, run below script.
It will remove provider name from FBA user name.


$InputFile = "d:\surya\Users.csv"
$URL= "http://spdev5:8003"
$site = New-Object Microsoft.SharePoint.SPSite($URL)
$web = $site.openweb("")
$file = ipcsv $InputFile
$i = 1

#variables
      $fbaUserName= $null
      $fbaformattedlogin = $null
     
      foreach ($line in $file)
      {
            $fbaUserName = $line.UserName  #.csv file column name  

# update 'scmemberprovider' with your provider name

          $fbaformattedlogin = "i:0#.f|scmemberprovider|" + $fbaUserName   
          Set-SPUser $fbaformattedlogin -Web $URL -DisplayName $fbaUserName
          #Get-SPUser $fbaformattedlogin -Web $URL
           
           # $i++
           # if($i -eq 4)
          #{
           #       break;
          #}
      }          
$web.Dispose()
$site.Dispose()
     

SharePoint 2010 Service Pack1 Instllation Steps

here is the document..

https://docs.google.com/file/d/0B_OpLHHlwhiRZlRnbGphbDJweDQ/edit?usp=sharing


missing office web apps server components in a farm SharePoint 2010

Error: Some farm products and patches were not detected on this or other servers. If products or patches are missing locally, you must quit this program and install the required products and patches on this server before restarting this wizard. if products or patches are missing on other server, you must install required products and patches on specific server.

To fix this error follow below steps.

here you can see all servers patches and which server is throwing errors 

Central Admin > Upgrade and Migration > Check product and patch installation status

in this situation some times you cannot open Central Admin then check below 

1) Check all application pools are running. If not start the pools 
2)Check Web Services Site running
2) IIS server > SharePoint Central adminstation site > right click start

sometimes you might get error w3svc not running. in this case 

IIS manager > Select sites >you can see right side Action menu > start 

now you can open Central admin site.

let's say you have app1 app2 web1 web2 servers in your farm. If app2 have any errors..

Run below Powershell command

Get-SPProduct -Local

Now run the configuration wizard. It will fix your problem.

still if you have any issues run the above command in all servers.



Friday, May 17, 2013

Restore-SPSite : The content type text/html; charset=utf-8 of the response mess age does not match the content type of the binding (application/soap+msbin1). I f using a custom encoder, be sure that the IsContentTypeSupported method is imp lemented properly


I got this while restoring SharePoint 2010 site. After lot of efforts I have found something wrong in my web.config files.

Make sure all nodes are implemented properly in the web.config files especially when you are working with forms based configuration. 

if you have any duplicate nodes or spaces it might get this error.

Check below web.config files 

1) Central administration
2) Your Web App
3) 14\Security Token\Web.Config


for ex,


<connectionStrings>
      <add name="SQLConnectionString" connectionString="server=servername;UID=webuser;PWD=1230;database=UsersDB; connection reset=false; enlist=true; min pool size=1; max pool size=125" providerName="System.Data.SqlClient" />
</connectionStrings>


<membership defaultProvider="i">
      <providers>
        <add name="i" type="Microsoft.SharePoint.Administration.Claims.SPClaimsAuthMembershipProvider, Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />
        <<add connectionStringName="SQLConnectionString" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="true" passwordAttemptWindow="10" applicationName="/" requiresUniqueEmail="false" passwordFormat="Hashed" name="myMemberProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />

      </providers>
    </membership>
    <roleManager defaultProvider="c" enabled="true" cacheRolesInCookie="false">
      <providers>
        <add name="c" type="Microsoft.SharePoint.Administration.Claims.SPClaimsAuthRoleProvider, Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />
  <add connectionStringName="SQLConnectionString" applicationName="/" name="myRoleProvider" type="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.0.0,Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />      </providers>
    </roleManager>





Thursday, May 2, 2013

Crawl everything under the hostname for each start address VS Only crawl the Site Collection of each start address

for more details go through below post regarding sharepoint 2010 search
http://suryapulipati.blogspot.com/2013/04/sharepoint-2010-search-and-scopes.html


http://spdev5:8004/ (root site collection)



Crawl everything under the hostname for each start address

 

Only crawl the Site Collection of each start address

You can go for this option, If you want to enable search for all site collections under one web app.

If you want to enable search for only one specific site collection
You have to create a scope to filter sitecol2 and 3 results in the root site collection.
You don’t need to create scopes If you are crawling only one site.
It will crawl all site collections under this site when add to the content source. You can use “Local SharePoint Sites”.


It crawls only root site collection not all site collections like sitecol2 and 3. You have to create custom content source

To filter results in the root site collection, you have to write rules in the scopes like this.

Include
Exclude (Sitecol2)
Exclude (Sitecol3)

No scopes needed.

Include

Create custom page in the root site collection and add “core results web part” to this page. Enter scope name in the web part scope property.
No need of custom page unless you are crawling more site collections.

In future if you want to enable search for sitecol2 or 3 you have to add the site to custom Content source.

When you crawl this site, you can see site collection2 documents in the root site collection search results (if you  have permissions on site2 or 3).
Now scopes will come into the picture again.

Include
Exclude (Sitecol2)
Exclude (Sitecol3)


So when you want to go for enable search for multiple site collections under one web app, better option is “Crawl everything under the hostname for each start address”


Followers