SharePoint Crawl Log Error: “The SharePoint item being crawled returned an error when attempting to download the item” .. for eg. *.aspx files

After some research I found a solution for that problem Open Regedit on your search server/sNavigate to this registry key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office Server\14.0\Search\Global\Gathering Manager Change Value “UserAgent” from  “MSIE 4.01” to “MSIE 8.0” Restart the SharePoint Search Service. Open a SharePoint PowerShell Get-SPSessionStateService If this returns false then we need to deploy one Enable-SPSessionStateService -DatabaseName “NameOfDatabase”

Clear SharePoint Config Cache with PowerShell

Add-PSSnapin -Name Microsoft.SharePoint.PowerShell –erroraction SilentlyContinue write-host “CLEAR CONFIG CACHE ON FARM” -fore green $servers = get-spserver | ?{$_.role -eq “Application”} foreach ($server in $servers) { $servername = $server.Address write-host “Stop Timer Service on server $servername” -fore yellow (Get-WmiObject Win32_Service -filter “name=’SPTimerV4′” -ComputerName $servername).stopservice() | Out-Null } foreach ($server in $servers) { $servername = $server.Address $folders…

Replace Text within multiple Wikipages using PowerShell

 Script for Sharepoint 2010 Enterprise Wikis! $logfile = “c:\logfile.txt”$web = Get-SPWeb “http://intranet/wikiurl”$list = $web.GetList(($web.ServerRelativeUrl.TrimEnd(“/”) + “/Wiki%20Pages”)) $search = “search_text”$replace = “replace_test” (get-date).ToString() + ” >>> Script Startet >> Parameter: Search = ” + $search + ” | Replace = “+$replace   | add-content $logfile(get-date).ToString() + ” >>> Script Startet >> Parameter: Search = ” + $search…

UserProfileApplication.SynchronizeMIIS: Failed to configure ILM, will attempt during next rerun. Exception: System.Data.SqlClient.SqlException

RUN AS FARMADMIN!!!!!   $sync_db = “PROD_SA_UPS_Sync” $ups_service_app_name = “User Profile Service”       net stop sptimerv4 $syncdb=Get-SPDatabase | where {$_.Name -eq $sync_db} $syncdb.Unprovision() $syncdb.Status=’Offline’ $ups = Get-SPServiceApplication  | where {$_.Displayname -eq $ups_service_app_name } $ups.ResetSynchronizationMachine() $ups.ResetSynchronizationDatabase() $syncdb.Provision() net start sptimerv4   Start the UserProfileSyncService again

Calculate and Set Distributed Cache Size

#calculation from: $membanks =get-wmiobject Win32_PhysicalMemory $sum = 0 $i=1 foreach ($membank in $membanks) {  write-host “Capacity Memory $i = ” ($membank.capacity/1024/1024)  $sum = ($membank.capacity/1024/1024) + $sum  $i=$i+1 }   write-host “Sum of Memory = ” $sum   $cachesize = ($sum – 2048)/2 if ($cachesize>16384)  {   $cachesize=16384 #not more than 16GB  }   write-host “Distributed…

HTTP 400 – Bad Request (Request Header too long) — error in Internet Information Services (IIS)   MaxTokenSize:   By default, the MaxFieldLength registry entry is not present. This registry entry specifies the maximum size limit of each HTTP request header. The MaxRequestBytes registry entry specifies the upper limit for the total size of the Request line and the headers. Typically, this registry entry is configured together with the…

Add listitems using PowerShell

$weburl = “http://mysharepoint”$listname = “TestList”$a = “Text1″$b = “Text2″$c = “Text3” Add-PsSnapin Microsoft.SharePoint.PowerShell -erroraction silentlycontinue  $web = Get-SPWeb -Identity $webUrl$list = $web.Lists[$listname]$newItem = $list.items.add()$newitem[“Title”] = $a$newitem[“Custom_Column1”] = $b$newitem[“Custom_Column2”] = $c$newitem.update()

Get Database Size for all SharePoint DBs via PowerShell

Add-PSSnapin microsoft.sharepoint.powershell $size = 0foreach ($db in Get-SPContentDatabase){    $size = $size + $db.DiskSizeRequired}$cdbs = "{0:N2}" -f($size/1gb)$ssa = Get-SPEnterpriseSearchServiceApplication$topo = $ssa | Get-SPEnterpriseSearchTopology  -Active$indexcomponent = (Get-SPEnterpriseSearchComponent -SearchTopology $topo | ?{$ -like "*index*"})[0]$folder = $indexcomponent.RootDirectory$indexsize = "{0:N2}" -f ((Get-ChildItem $folder -Recurse | Measure-Object -sum  Length).sum/1GB)$dbs = Get-SPDatabase clswrite-host "————————————————————————————–" -fore greenGet-Datewrite-host ""write-host "————————————————————————————–" -fore greenwrite-host "SUM: Content…


Perform an IIS Reset on all your SP Servers via PowerShell

This script will list all your SP Servers and restarts IIS on all of them.   add-pssnapin microsoft.sharepoint.powershell $spserver = get-spserver | ?{$_.role -eq "Application"} foreach ($server in $spserver) {    write-host "Performing IIS Reset on Server:"$    iisreset $server.Name }  


The site is not valid. The ‘Pages’ document library is missing.

ULS Log tells me that: The site is not valid. The ‘Pages’ document library is missing. ……   Solution to this problem was really simple. I’ve found a blogentry on, which tells me to update the “PAGES ID”, and it worked well.     $web = get-spweb “http://site-collection/path-to-affected-site” $correctId = $web.Lists[“Pages”].ID $web.AllProperties[“__PagesListId”] = $correctId.ToString()…

WebDav: Prompt for Credentials When Accessing FQDN Sites From a Windows Vista or Windows 7 Computer   Click Start, type regedit in the Start Search box, and then press ENTER. Locate and then click the following registry subkey: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WebClient\Parameters On the Edit menu, point to New, and then click Multi-String Value. Type AuthForwardServerList, and then press ENTER. On the Edit menu, click Modify. In the Value data box, type the…

Partial "Index Reset" (per ContentSource or StartAddress)

This script will remove and re-add your content source’s start addresses. SharePoint will more or less rebuild the index for these sources, when a full crawl is started.     $sourceName = “Local SharePoint sites”   $SSA = Get-SPEnterpriseSearchServiceApplication $source = Get-SPEnterpriseSearchCrawlContentSource -Identity $sourceName -SearchApplication $SSA $startaddresses = $source.StartAddresses | ForEach-Object { $_.OriginalString } $source.StartAddresses.Clear()…

Event 2159 / 5586

Event 5586 (SharePoint Foundation) of severity ‘Error’ occurred 540 more time(s) and was suppressed in the event log.   Reasons for this Event:     Possible Fix: 1.Open the SQL Server Configuration Manager (assuming you are using SQL 2008 or higher) 2.Browse down to SQL Server Network Configuration – Protocols for <namedserverinstance> 3.Right-click “Named…

Add a User and/or Group to all SiteCollections as SiteCollection Admin

This Script will automatically add a User and/Or Group to ALL SiteCollections in ALL WebApplications of your SharePoint Farm. It can be very easily modified to do this action on just one WebApp  by editing the line $wapps = Get-SPWebApplication to $wapps = Get-SPWebApplication “mywebappname”      #example: $AccountList = @(“DOMAIN\User” , “DOMAIN\Group”) $AccountList = @(“domain\myuser”)…

List all Databases from your SQL Server via PowerShell

I’ve created this script, because some guys wanted to know which DBs are available. It can be used to e.g. mount some unmounted contentdatabases. ———– function ListAllSQLDBs {param ( $DatabaseServer) if ($DatabaseServer -eq $null)     $DatabaseName=   “master”     $QueryString = “EXEC sp_databases”     $SQLDBs = New-Object system.Data.DataTable     $col1 = New-Object system.Data.DataColumn DBName     $SQLDBs.columns.add($col1)    …

Add Query Suggestions via PowerShell

$myquerysuggestions_en = "SharePoint English"$language_en = "EN-US" $myquerysuggestions_en = "SharePoint German"$language_de = "DE-DE" $sa = Get-SPEnterpriseSearchServiceApplication foreach ($en_s in $myquerysuggestions_en) {New-SPEnterpriseSearchLanguageResourcePhrase -SearchApplication $sa -Language $language_en -Type QuerySuggestionAlwaysSuggest -Name $en_s}foreach ($en_s in $myquerysuggestions_en) {New-SPEnterpriseSearchLanguageResourcePhrase -SearchApplication $sa -Language $language_de -Type QuerySuggestionAlwaysSuggest -Name $de_s}


SharePoint Social Rating Updates moreoften than once per hour

These two TimerJobs are responsible for Social Rating Updates: ( User Profile service application – social data maintenance Aggregates social tags and ratings and cleans the social data change log. User Profile service application proxy – social rating synchronization Synchronizes rating values between the social database and content database. Per default these Jobs are running…

The password for the content access account cannot be decrypted…..

Errormessage: The password for the content  access account cannot be decrypted because it was stored with different  credentials. Re-type the password for the account used to crawl this content.  Solution: Use user@domain.local instead of domain\user when specifiying the Default Content Access Account    

WebDav: Move Files between WebDav Folders   It’s most of all only possible to “move” data between WebDav Folder per Copy/Paste. A REAL move is mostly not possible (just in special constellations)

AntiVirus for SharePoint 2013 – Status 05.Mar 2013

  Microsoft’s Position on Antivirus Solutions for Microsoft SharePoint Portal Server <>   SharePoint Antivirus alternatives to Forefront <>     Now the “good” news from Spencer Harbar: = currently beta but RTM coming soon (currently the one and only AV for SharePoint which is supported)