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

Monday, May 21, 2012

Delete Orphaned Databases

Example for all UPS Databases
Get-SPDatabase | Where{$_.Name -like "*ups*"} | ForEach {$_.Delete()}

Thursday, April 19, 2012

Start all Health Analyzer Jobs

get-sptimerjob | where {$_.Name -like "*Health*" -and $_.Name -like "*all*"} | start-sptimerjob

Monday, April 16, 2012

Rename Central Administration Content Database

$ca_webapp_name = "http://centraladmin_url:9090"

$new_ca_contentdbname = "Content_CentralAdministration"

$old_ca_contentdatabase = get-spcontentdatabase -webapplication $ca_webapp_name

new-spcontentdatabase -name $new_ca_contentdbname  -webapplication $ca_webapp_name


$new_ca_cdb_id = Get-SPContentDatabase -WebApplication $ca_webapp_name | where {$_.Name -eq $new_ca_contentdbname}



get-spsite -contentdatabase $old_ca_contentdatabase | move-spsite -destinationdatabase $new_ca_cdb_id

 .... i will test this solution at 19th. April 2012

Tuesday, April 10, 2012

Visual Upgrade

$site = Get-SPSite("SP2007 Look And Feel SiteCollection")
$site.VisualUpgradeWebs()

Monday, April 2, 2012

Silent SharePoint Server installation

Create a BAT file within your SharePoint Binary Path: %~dp0setup.exe /config %~dp0SPconfig.xml

Create a File: SPConfig.xml within your SharePoint Binary Path and copy the following text into it.


<Configuration>
 <Package Id="sts">
  <Setting Id="LAUNCHEDFROMSETUPSTS" Value="Yes"/>
 </Package>
 <Package Id="spswfe">
  <Setting Id="SETUPCALLED" Value="1"/>
         <Setting Id="REBOOT" Value="ReallySuppress"/>       
  <Setting Id="OFFICESERVERPREMIUM" Value="1" />
 </Package>
 <Logging Type="verbose" Path="C:\SharePoint\Log" Template="SharePoint Server Setup(*).log"/>
 <PIDKEY Value="12345-12345-12345-12345-12345" />
 <DATADIR Value="C:\SharePoint\Data"/>
 <Display Level="none" CompletionNotice="yes" />
 <Setting Id="SERVERROLE" Value="APPLICATION"/>
 <Setting Id="USINGUIINSTALLMODE" Value="0"/>
 <Setting Id="SETUP_REBOOT" Value="Never" />
 <Setting Id="SETUPTYPE" Value="CLEAN_INSTALL"/>
</Configuration>

PS Script to Download all PreRequisites Files

http://gallery.technet.microsoft.com/scriptcenter/bcf3332d-f726-4ac7-b01a-eeda4b7ece8e

Configure Incoming Mail

http://technet.microsoft.com/en-us/library/cc262947.aspx

Summary:

Thursday, March 29, 2012

Query Suggestions

$myquerysuggestion = "SharePoint"

$sa = Get-SPEnterpriseSearchServiceApplication
New-SPEnterpriseSearchLanguageResourcePhrase -SearchApplication $sa -Language EN-US -Type QuerySuggestionAlwaysSuggest -Name $myquerysuggestion

Wednesday, March 28, 2012

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" 

Wednesday, March 21, 2012

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:

Tuesday, March 20, 2012

No Help Collection was found. / Help content cannot be displayed.

http://support.microsoft.com/kb/939313

cd %COMMONPROGRAMFILES%\Microsoft Shared\web server extensions\14\BIN
Hcinstal.exe /act InstallAllHCs

(do this action on all your SharePoint Servers)

Friday, March 16, 2012

SharePoint 2010 Browser Support

Great Article:
http://technet.microsoft.com/en-us/library/cc263526.aspx

But in general:
Only Internet Explorer 7-9 32Bit is fully supported.
All other browsers are just supported WITH limitations.

Wednesday, March 14, 2012

WebDav: Move Files between WebDav Folders

http://support.microsoft.com/kb/825522/en-us

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)

Monday, March 12, 2012

Replace Text within multiple Wikipages using PowerShell




Simple Sitecollection Backup

If you have for each site collection a seperate contentdatabase, you can use this script.
Otherwhise you've just to modify the backupfilename.

SharePoint Licensing

A great site about the SP licensing models. http://sharepoint.microsoft.com/en-us/buy/pages/licensing-details.aspx

Thursday, March 1, 2012

MySite: An error occurred trying to save your profile

If you've multiple languages installed, you've alway to add "English" in your Managed Metadata Set.
You can still choose your default danguage to any other you want.





This is, what i've logged in ULS:

ProfileUI.SavePropertyValue(): System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values. Parameter name: lcid
at Microsoft.SharePoint.Taxonomy.TermStore.ValidateLanguage(Int32 lcid)
at Microsoft.SharePoint.Taxonomy.Term.GetDefaultLabel(Int32 lcid)
at Microsoft.SharePoint.Portal.WebControls.ProfilePropertyLoader.<>c__DisplayClass7.<GetValueCollectionStringRepresentation>b__6(Term i)
at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
at Microsoft.SharePoint.Portal.WebControls.ProfilePropertyLoader.GetValueCollectionStringRepresentation(ProfileValueCollectionBase valueCollection)
at Microsoft.SharePoint.Portal.WebControls.ProfilePropertyLoader.ValueEx(String strPropName)
at Microsoft.SharePoint.Portal.WebControls.ProfileUI.SavePropertyValue(ProfileBase objProfile, ProfileSubtypeProperty prop, Boolean bIgnoreEmpty).

Friday, February 24, 2012

Problem with SharePoint Products AD DS Container after updating server with SharePoint updates

Following Text from: http://technet.microsoft.com/en-us/library/ff730261.aspx

MySites orphaned / old memberships not updated

Run the command stsadm -o sync -listolddatabases 1 You should then get a list of database GUID

Run the command stsadm -o sync -deleteolddatabases 1 This will remove the record from the SSP database but will not touch the actual Content Database.

(Run this commands as a User which has Full Control to the User Profile Service Application!)

Wednesday, February 22, 2012

“Object not found” error in search service crawl Logs

My problem was that the crawler jobs "Content Source" was the "Default Zone" without alternate access mapping.
As soon I've modified the Content Source to the AAM Zone, the error was gone.

eg for my Content Source:
 Not working: http://intranet (Default Zone)
 Working: http://intranet.domain.lcl (AAM)

Monday, February 20, 2012

Necessary Firewallports if SharePoint is in a DMZ using a One-Way-Trust

Direction: ALL SharePoint Servers --> Domain Controllers in Trusted Domain

53/TCP/UDP --> DNS
88/TCP/UDP --> Kerberos
135/TCP --> RPC
389/TCP/UDP --> LDAP
3286/TCP --> LDAP GC

Direction: ALL SharePoint Servers --> SMTP Servers in Trusted Domain

25/TCP --> SMTP


Direction: Clients --> ALL SharePoint FrontEnd Servers
80 or 443 /TCP

Direction: Admin Clients --> ALL SharePoint Application Servers
e.g.:9090/TCP for Central Administration

First Query after Crawl takes up to 60 seconds

You have SharePoint 2010 SP1 CU12:

Every time you are performing a search query on any web application the first query always takes about 60 seconds.
When you are performing the second search query for the same term or another term the query response time is under 3 seconds.


Thursday, February 16, 2012

Activate a Feature on all SiteCollections

$FeatureId = $(Get-SPFeature -limit all | where {$_.displayname -eq "OfficeWebApps"}).Id
Get-SPSite -limit ALL |foreach{Enable-SPFeature $FeatureId -url $_.URL }

Wednesday, February 15, 2012

Search service is not able to connect to Administration component server

$AdminComponentServer = "ServerName"

$varInstance = Get-SPEnterpriseSearchServiceInstance -local  

Start-SPEnterpriseSearchServiceInstance -Identity $AdminComponentServer

$varSearchApp = get-spenterprisesearchserviceapplication

set-spenterprisesearchadministrationcomponent –searchapplication $varSearchApp –searchserviceinstance $varInstance

...Wait a few minutes.....

(http://blogs.technet.com/b/poojk/archive/2011/11/28/sharepoint-2010-search-service-is-not-able-to-connect-to-administration-component-server.aspx)

Wednesday, January 11, 2012

Nicht behandelte Ausnahme in der Silverlight Anwendung

  1. Zentraladministration aufrufen
  2. Unter Anwendungsverwaltung den Link Webanwendungen verwalten aufrufen
  3. Die entsprechende Webanwendung anklicken
  4. Im Ribbon das Menü Allgemeine Einstellungen aufklappen und dort wieder den Punkt Allgemeine Einstellungen auswählen
  5. Die Webseiten-Sicherheitsüberprüfung auf Ein stellen:
Danach sollte der Fehler nicht mehr auftreten.

Technisch hängt das Problem mit dem Silverlight Client Objektmodell zusammen, welches den WCF (Windows Communication Foundation) Endpunkt bei ausgeschalteter Sicherheitsüberprüfung nicht öffnen kann.

Monday, January 9, 2012

Visual Downgrade

$Web=Get-SPWeb “Full URL of 2010LookAndFeel Site”
$Web.UIVersion=3
$Web.UIVersionConfigurationEnabled=$true
$Web.update()