IISRESET across SharePoint farm servers

Here is something I use when I want to perform an IISRESETacross an entire SharePoint farm. Its useful if you have a large SharePoint farm.
Oh – yea, this will take down your farm while the IISRESET is restarting the services, so its best to test this on a non production environment first. Ensure you have an outage/agreed maintenance window to perform this task on a production farm.

All you got to do is spin up PowerShell on any SharePoint server in the farm and run this:

Write-Host -ForegroundColor Blue “IIS will  be reset across the entire farm”
Add-PSSnapin Microsoft.SharePoint.PowerShell -erroraction SilentlyContinue
[array]$servers= Get-SPServer | ? {$_.Role -eq “Application”}
$farm = Get-SPFarm
foreach ($server in $servers)
{
     Write-Host -ForegroundColor Yellow “Attempting to reset IIS for $server”
        iisreset $server /noforce “\\”$_.Address
        iisreset $server /status “\\”$_.Address
        Write-Host
        Write-Host -ForegroundColor Green “IIS has been reset for $server”
        Write-Host
}
Write-Host -ForegroundColor Green “IIS has been reset across the SharePoint Farm”
Start-Sleep -Seconds 5
Write-host

 

Reference: http://wellytonian.com/2012/04/iis-reset-your-whole-sharepoint-farm/


Retrieve / Decrypt lost password from Application Pools in IIS SharePoint

If you don’t have access to your organisations password safe or if you or your team mate has forgotten to add a password to a certain service account used in SharePoint, it is possible to retrieve the password from IIS!

There is a way to find out the application pool identity password via command line thanks to the inetsrv appcmd! :)

Open IIS and take note of the application pool name that runs the application pool identity with the password you want to retrieve.
In my example, I have demonstrated the extract of the “SecurityTokenServiceApplicationPool“, which runs the SharePoint farm service account as its identity. So, if you are after another application pool, please replace this with the corresponding Application Pool name in your IIS.

Keep in mind – this works for any IIS application pool – SharePoint web app, SharePoint service applications or non SharePoint IIS / .NET sites application pools!

Open a command prompt and run this:

&$env:windir\system32\inetsrv\appcmd.exe list apppool "SecurityTokenServiceApplicationPool" /text:ProcessModel.Password

Thanks:
http://joelblogs.co.uk/2012/09/22/recovering-passwords-for-sharepoint-2010-farm-web-application-and-service-application-accounts/


Configure IP forwarding for NLB PowerShell

There are advantages of having two Network Interface Cards – NICs on webservers – specially with SharePoint, since I work with SharePoint most of the time (some other open source products too!).

When configuring ‘Unicast’ NLB mode, Unicast takes over the NIC, thats why we used to create two NICs and set up IP forwarding so that requests that arrive on one NIC (Public) are sent to the other NIC (Private) connected to the other servers in the domain.

Here are the steps I follow to configure NLB and IP forwarding between the two NICs (multi-homed computer for the experienced). 😉

1. I usually rename the first NIC as “Private”.

2. Add a new NIC and call it “Public”.
Configure an IP address and Subnet mask. Do not configure a default gateway on the Public NIC.

3. Configure the Windows NLB cluster.
In Windows Server 2012, to add the NLB feature:
Add-WindowsFeature -Name NLB
Add-WindowsFeature -Name RSAT-NLB
Configure the Windows NLB cluster (google up for more info)

4. Configure IPv4 forwarding via PowerShell:
Set-NetIPInterface -InterfaceAlias Public -AddressFamily IPv4 -Forwarding Enabled

5. Point your DNS A record to the IP of the ‘Public’ NIC.


Have you tried the Merge-SPLogFile command when troubleshooting?

When troubleshooting SharePoint issues, the best way to filter out all the noise from your log files and sort it for easier troubleshooting is to use the ULS Log viewer tool.

Refer to my blog post on the ULS Log viewer comparison and verdict to get a feel for the other options and see how I got to my conclusion there. http://www.jeremytaylor.net/2012/07/14/sharepoint-uls-log-viewer-tool-comparison-and-verdict/

However, this ULS Log viewer tool does not display logs from other servers in the SharePoint farm, unless obviously its a single server farm.

The way to help you with a multiserver farm is to run the Merge-SPLogFile command in the SharePoint management shell. This command “merges” all logs from other servers in the farm and combines them into one ULS log file on the local server. That file can then be opened in your favourite ULS log viewer for troubleshooting.

Note: this works in both SharePoint 2013 and SharePoint 2010.

So how do we use it?

Here is an example of how I use it to grab all logs between say 10AM and 10:30AM on the 23rd July 2013:

Merge-SPLogFile -Path "D:\Temp\MergedLog-20130723-1000-1030.log" -StartTime "23/07/2013 10:00:00" -EndTime "23/07/2013 10:30:00"

If I know the correlation ID, then I would recommend you run the following command after updating it to your correlation ID:

Merge-SPLogFile -Path D:\Temp\MergedLog-419ac99c-81b2-0077-378d-3c23767d2955.log -Correlation 419ac99c-81b2-0077-378d-3c23767d2955

 

 

2014-11-07_10-39-43

Merge-SPLogFile looks across all the servers in the farm, aggregates the logs with the correlation ID and creates the aggregated .log file.

The merged log file containing only the  information you specified and require. In this case, a certain correlation ID.

The merged log file containing only the information you specified and require. In this case, a certain correlation ID.

 

Open the log file up in ULSViewer!

Open the log file up in ULSViewer!

 

There are a lot more examples of what you can do with Merge-SPLogFile you can get by typing this in the SharePoint management shell:

Get-help Merge-SPLogFile -examples Continue reading 

SharePoint 2013 SQL “best practices”

Note – this blog post has a title ‘best practices’. I named it so to match the referred TechNet article entitled “Best practices for SQL Server in a SharePoint Server farm”. So please forgive me for using the term ‘best practices’. Probably ‘guidelines’ or ‘good practices’ is a better name for this article.

Getting back to the topic: Some times you need a refresher when it comes to guidelines in setting up SQL for SharePoint – especially when setting up the newer SharePoint 2013.

There is a Technet article I would like to refer to here which specifically refers to ‘best practices’ for SQL server in a SharePoint 2013 environment. There are a few changes to note when it comes to SharePoint 2013.

A couple of important things to note:

Do not enable auto-create statistics on a server that hosts SQL Server and SharePoint Server. Enabling auto-create statistics is not supported for SharePoint Server.

Set the MAXDOP (max degree of parallelism) setting to 1 and nothing else. Setting the max degree of parallelism to any other number can cause a less optimal query plan to be used that will decrease SharePoint Server 2013 performance.

There is also some guidance on setting up the SQL instance for better performance and managing the SharePoint databases.

Here’s the article for further reading:

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


Configure DirSync and SSO ADFS with Office 365 – Videos

Here are a couple of videos from Microsoft Services – Microsoft Partner Network videos on configuring DirSynd and Single Sign-On SSO with ADFS for your Office 365. These videos have helped me understand whats involved and how do I go about setting it up.

Warning: These are technical videos. Do not attempt these without planning your deployment with your managerial / architects and infrastructure staff! There is no substitute to good planning. These videos are also meant to be a bookmark for me :)

Note: These videos refer to older version of DirSync which did not have password sync. There is a new version of DirSync which does password syncs. Read more here: http://blogs.technet.com/b/educloud/archive/2013/06/03/new-azure-active-directory-sync-tool-with-password-sync-is-now-available.aspx

Office 365: Configuring DirSync and Single Sign On with ADFS – Part 1

Module 1: Understanding Identities
Module 2: Environment Preparation for Single Sign-On & Directory Synchronization (DirSync)

Office 365: Configuring DirSync and Single Sign On with ADFS – Part 2
Module 3: Deploying SSO and AD FS 2.0
Module 4: Deploying DirSync


Download Skydrive Pro standalone

Upgrading to SharePoint 2013 and require syncing files down to your desktop without having to upgrade to Office 2013 to get Skydrive Pro?

On the 20th of May 2013, Microsoft published a standalone Skydrive Pro client. The standalone SkyDrive Pro sync client allows users of SharePoint 2013 and SharePoint Online in Office 365 to sync their personal SkyDrive Pro and any SharePoint 2013 or Office 365 team site document libraries to their local machine for access to important content on and offline.

Download the Skydrive Pro client for Windows

Supported Operating Systems: Windows 7, Windows 8, Windows Server 2008 R2, Windows Server 2012

Can be installed alongside Office 2010 and Office 2007. However I haven’t really seen many Office 2007 installations on Windows 7. :)

Limits on syncing content in SkyDrive Pro and other SharePoint libraries

Note the following limitations related to syncing libraries to your computer with SkyDrive Pro:
You can sync up to 20,000 items in your SkyDrive Pro library, including folders and files.
You can sync up to 5,000 items in other SharePoint libraries, including folders and files.
In any library, you can download files up to 2 GB.
Reference :http://office.microsoft.com/en-us/support/sync-a-library-to-your-computer-HA102832401.aspx


SharePoint Backup and Restore best practices

Some time ago, I was collecting some Backup & Restore best practices for SharePoint and I came across this post.

It talks about various aspects of backup and restore for a SharePoint farm. Its based on SharePoint 2010 but can be applied to SharePoint 2013.

  • IIS Configurations required in a Disaster Recovery
  • Backup Scenarios
  • Restore Scenarios
  • SQL Backup maintenance plans
  • Overview of monitoring with SCOM (System Center Operations Manager)
  • DPM (System Center Data Protection Manager)

Worth a look: http://blogs.technet.com/b/surama/archive/2012/05/29/sharepoint-2010-backup-and-restore-best-practices.aspx