Download and Deploy CRLs fully automated

COMMENT BEGIN ************************************************************************************ PREREQUISITES ************************************************************************************ Configuration @ Sharepoint Enable-PSRemoting Enable-WSManCredSSP -Role server -force Configuration @ Client Enable-PSRemoting Enable-WSManCredSSP -Role Client -DelegateComputer * -Force ************************************************************************************ RUNAS USER ************************************************************************************ Must be able to download files from the internet must be local admin on sp servers must have read/write access to download path COMMENT END $download_path = “\\fileserver\shaere$\CRLs\crl.microsoft.com\”…


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 | ?{$_.name -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…

4

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:"$server.name    iisreset $server.Name }  

4

Very slow SharePoint > what can you do against it without upgrading your hardware

There is a very important support article out there, about what you can do if your SharePoint is sometimes very slow. E.g.: on the first start of a SiteSometimes during the day a search query will take about a minute until you get results….. Just look on that article: http://support.microsoft.com/kb/2625048 it will improve your "feeled" performance…


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}

1

Partial Index Reset of a single content source

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 the next 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) }


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…


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    


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”)…


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…


WebDav: Prompt for Credentials When Accessing FQDN Sites From a Windows Vista or Windows 7 Computer

http://support.microsoft.com/kb/943280   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…


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….


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:    …


SQL Query: Force to 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    


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>   SharePoint Antivirus alternatives to Forefront <http://blogs.msdn.com/b/ronalg/archive/2012/12/06/sharepoint-antivirus-alternatives-to-forefront.aspx>     Now the “good” news from Spencer Harbar:   http://www.harbar.net/archive/2013/02/22/Antivirus-and-SharePoint-2013.aspx http://www.eset.com/beta/sharepoint/ = currently beta but RTM coming soon (currently the one and only AV for SharePoint which is supported)


List all Dataabases 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…


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”


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()…


Delete Webs Recursive with PowerShell

  $web = Get-SPWeb “http://localhost/sites/webwithsubwebs/”   function RemoveSPWebRecursively([Microsoft.SharePoint.SPWeb] $web) {       $subwebs = $web.GetSubwebsForCurrentUser()         foreach($subweb in $subwebs)     {         RemoveSPWebRecursively($subweb)         $subweb.Dispose()     }     Remove-SPWeb $web -Confirm:$false }     RemoveSPWebRecursively $web


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()