Monday, May 6, 2013

Partial "Index Reset"

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()
ForEach ($address in $startaddresses ){ $source.StartAddresses.Add($address) }

Tuesday, April 30, 2013

Check a Lists BrowserFileHandling. --> Set it to Strict or Permissive

Add-PSSnapin -Name Microsoft.SharePoint.PowerShell –erroraction SilentlyContinue

$problem_web = "http://mysharepoint/"
$problem_list = "Tasks"
    
 $set_bfh_to = "strict"
 #$set_bfh_to = "permissive" 
                                                
$web=get-spweb $problem_web
$list=$web.Lists[$problem_list]         
write-host "BrowserFileHandling Setting:"$list.BrowserFileHandling -ForegroundColor GREEN



$web=get-spweb $problem_web
$list=$web.Lists[$problem_list]
$bfh_old = $list.BrowserFileHandling      
$bfh_new = $list.BrowserFileHandling =  $set_bfh_to
write-host "BrowserFileHandling Setting set from $bfh_old to $bfh_new."-ForegroundColor GREEN
$list.Update()

Tuesday, March 5, 2013

SharePoint Social Rating Updates moreoften than once per hour

These two TimerJobs are responsible for Social Rating Updates:
(http://technet.microsoft.com/en-us/library/cc678870.aspx)
  • 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 hourly. You can modify these jobs to run more than once an hour up to once per minute.


Performance Considerations when you let this timerjob run e.g.: once per minute:
 --> You have to monitor especially the performance of your social database, because this is the single point where every rating information is inserted.


 How to find out how long these TimerJobs are currently running:

$social_timer = get-sptimerjob | ? {$_.Name -like "*social*"}

foreach ($timer in $social_timer)
   {
    write-host "Duration of TimerJob:" $timer.name "(hh:mm:ss,ms)" -foregroundcolor yellow
   
     $historyentries = $timer.historyentries
     foreach ($hist in $historyentries)
     {
        $duration = $hist.EndTime - $hist.StartTime
        write-host $duration.hours":"$duration.minutes":"$duration.seconds","$duration.milliseconds -foregroundcolor green
     }
   }

AntiVirus for SharePoint 2013 - Status 05.Mar 2013


Microsoft's Position on Antivirus Solutions for Microsoft SharePoint Portal Server
<http://support.microsoft.com/kb/322941>



Now the "good" news from Spencer Harbar:

http://www.eset.com/beta/sharepoint/ = currently beta but RTM coming soon (currently the one and only AV for SharePoint which is supported)

SQL Query: Shrink all DBs

DO NOT USE THIS SCRIPTS WITHIN YOUR PROD ENVIRONMENT!!!!

sp_MSForEachDB '
backup log [?] to disk = ''nul'''
go

sp_MSForEachDB '
use [?];
checkpoint
'
go


sp_MSForEachDB '
USE [?];
DBCC SHRINKFILE (N''?_log'' , 1024)
'
go


PowerPoint: Link within Email -> Check out do not work properly

This KB describes the problem exactly and brings up a solution: http://support.microsoft.com/kb/2661910

But in a few sentences.
There are two ways to solve that problem:
  1. add a RegKey to all Clients
    Windows Registry Editor Version 5.00
    [HKEY_CLASSES_ROOT\MIME\Database\Content Type\application/vnd.ms-powerpoint.presentation.12]
    "Extension"=".pptx"
  2. Set the Browser File Handling setting within WebApplication settings to permissive instead of strict.
Here's a little more information to "Browser File Handling" (what is it)
http://social.technet.microsoft.com/wiki/contents/articles/8073.sharepoint-2010-and-2013-browser-file-handling-deep-dive.aspx

Thursday, January 3, 2013

max degree of parallelism

..Has to set to "1" on SQL Servers for SharePoint environments

Best practices: http://technet.microsoft.com/en-us/library/hh292622(v=office.14).aspx
Storage and SQL Capacity http://technet.microsoft.com/en-us/library/cc298801(office.14).aspx

Calculate and Set Distributed Cache Size

#calculation from: http://technet.microsoft.com/en-us/library/jj219613.aspx
$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 Cachesize will be updated to: " $cachesize
Update-SPDistributedCacheSize -CacheSizeInMB $cachesize

Tuesday, October 23, 2012

SQL Query: List all SQL Databases except System DB's


SELECT [name]
FROM master.dbo.sysdatabases
WHERE dbid > 4

Wednesday, October 3, 2012

Get Content DB Size of all Content DBs as "Report"

Add-PsSnapin Microsoft.SharePoint.PowerShell -erroraction silentlycontinue 
$cdbs = get-spcontentdatabase
$sum = 0
Write-host "****************************************************" -foregroundcolor white
foreach ($cdb in $cdbs)
 {
 $size = [System.Math]::round(($cdb.DiskSizeRequired/1024/1024/1024),2)
 write-host $size "GB" "--->" $cdb.name   -foregroundcolor green
 $sum = $sum + $cdb.DiskSizeRequired
 }
Write-host "****************************************************" -foregroundcolor white
write-host "Total Space Used:" ($sum/1024/1024/1024/1024)"TB"  -foregroundcolor red
write-host "Total Space Used:" ($sum/1024/1024/1024)"GB"  -foregroundcolor red
Write-host "****************************************************" -foregroundcolor White

IIS ApplicationHost.config - Request Filtering (e.g. Filetype *.mdb)

If you want to allow a filetype like e.g. *.mdb it's not enough to allow that type within SharePoint.
You've to allow it as well within IIS (if request filtering is enabled)

That can be done manually




OR: if you've multiple IIS Servers within your SharePoint Farm via PowerShell Script:


$servers = "server1","server2","server3","server4"
foreach ($server in $servers)
 {
 

 Invoke-Command -computername $server -ScriptBlock {
 
        import-module webadministration
 
        Function Enable-IISFileExtension
        {
            PARAM(
                 $ConfigFile,
                 $FileType,
                 $Flag
        
                 )
            $xml = [XML](Get-Content -Path $ConfigFile -ErrorAction STOP)
            $item = $xml.configuration."system.webServer".security.requestFiltering.fileExtensions.add | Where-Object {$_.fileExtension -match "$FileType"}
            $item.allowed = $Flag
            $xml.Save($ConfigFile)
   
            return $xml.configuration."system.webServer".security.requestFiltering.fileExtensions.add | Where-Object {$_.fileExtension -match "$FileType"}
   
        }
        Enable-IISFileExtension -ConfigFile "C:\Windows\System32\inetsrv\config\applicationHost.config" -FileType ".mdb" -Flag "True"
 
 
  Exit-PSSession
  }
 } 



Tuesday, October 2, 2012

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 blogs.technet.com, 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()
$web.Update()

$web.AllProperties["__PublishingFeatureActivated"] = "True"
$web.Update()

Thursday, August 2, 2012

What's new in SharePoint 2013 (SP15)

Dear all,
I've found a really exciting Site where some new SharePoint features gets introduced.

http://technet.microsoft.com/en-us/sharepoint/fp142374.aspx

At the following Link, you'll find some training modules for IT PROs
http://technet.microsoft.com/en-US/sharepoint/fp123606

As i'm configuring at the moment a LAB environment , I'm going to post some new Issues/Solutions very soon.


Wednesday, July 4, 2012

Event ID 8193 Volume Shadow Copy Service Error

Volume Shadow Copy Service error: Unexpected error calling routine RegOpenKeyExW(-2147483646,SYSTEM\CurrentControlSet\Services\VSS\Diag,...). hr = 0x80070005, Access is denied.
Context:
Writer Class Id: {0ff1ce14-0201-0000-0000-000000000000}
Writer Name: OSearch14 VSS Writer
Writer Instance ID: {07c936a8-347c-4e39-8014-2a057f611382}


Solution:
Go to the details tab within the event.
There you'll see some information AND a USER --> the SharePoint Search Admin Account.

Just give that user Full Control at the Registry Key:
HKLM\SYSTEM\CurrentControlSet\Services\VSS\Diag

After a Serverreboot the errormessage shouldn't appear again.

Tuesday, July 3, 2012

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:
http://technet.microsoft.com/en-us/library/cc561042(v=office.12).aspx


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 Pipes” in the right pane and choose Enable
4.You may need to restart the server for changes to take effect


Granting the farm database access account “VIEW SERVER STATE” under the SQL Server properties will also resolve this issue.

use [master]
GO
GRANT VIEW SERVER STATE TO [domain\timer_service_user]
GO

Friday, June 22, 2012

Get Template Used by Site

$site_where_template_is_needed = get-spweb "http://rooturl/sites/sitename"

write-host $site_where_template_is_needed.webtemplate




Site Templates: get-spwebtemplate

Tuesday, June 19, 2012

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

Monday, June 18, 2012

Stop all Incoming Mail Services

Get-SPServiceInstance | ? {$_.Typename -eq "Microsoft SharePoint Foundation Incoming E-Mail"} | Stop-SPServiceInstance -Confirm:$False