AutoSPInstaller: Configuration

SharePoint, CodePlex
This entry is part 2 of 4 in the series AutoSPInstaller

This is a continuation of my previous post titled “AutoSPInstaller: Getting Prepared”

In my previous post, I showed you how to stage all the software. Do this once, you’re set for life! OK, maybe not for life, but at least for any SharePoint server installs you’ll need to do now or later. Next, we need to configure several files.

Configuration Files

Here’s the list of files we need to configure:

  • answerfile-ForeFront.xml – Optional. This is the configuration file if you’re installing ForeFront Protection 2010 for SharePoint.
  • config.xml – Required. This is the settings for the SharePoint installer.
  • config-OWA.xml – Optional. This file is used to configure Office Web Apps.
  • AutoSPInstallerInput.xml – Required. This is the file where we’ll configure all the options for AutoSPInstaller, the actual configuration of SharePoint.

The main file we need to configure (AutoSPInstallerInput.xml) is also the most complex, so let’s save it for later. Use your favorite XML editor, avoid Notepad or WordPad, they make things harder. Personally, I like Notepad++ which can be downloaded here.

ForeFront

AutoSPInstaller will call “answerfile-ForeFront.xml,” which replaces the “answerfile.xml” that you’ll find in the ForeFront folder. Most of the options are self-explanatory so I just want to point out one section:

 
COCOLYNN\svc.spFarm 
pass@word1 

Specify a user account and password for database access. This account should be entered using the Domain\Account format when the server is part of a domain. This account needs a lot of privileges, it must:

  • Be a member of the Local Administrators group on the SharePoint server(s).
  • have SharePoint Farm Administrators privileges.
  • Be a member of the SQL sysadmin role on the database server.

These fields must be populated with valid credentials or unattended installations will fail. I’m using the Farm account. Why? Because it requires similar permissions. The Farm account needs to be a local administrator at least for provisioning User Profile Service. Even after initially installing UPS, it needs that right to be able to restart (re-provision) after backups. It needs to be a Farm Administrator (of course) and although it doesn’t require sysadmin role on the database server, it does require dbcreator, securityadmin and dbo on all the databases. Sysadmin role is not a far stretch from that.

In the end, I’d rather give my Farm account a bit more permissions to run ForeFront than to have another account with very high privileges. Now, I just need to secure/audit this one account.

For detailed information on all the options in this configuration file, check out the TechNet article here.

SharePoint Installer

The “config.xml” is the same as the one found on the SharePoint DVD or ISO file. It’s where we configure SharePoint installer options. Let’s look at some of the options.

 

The INSTALLLOCATION tells SharePoint where to install the binaries (bits). For example, if you wanted to install to a non-system drive (e.g., E:\), this is where you’d change it. I recommend leaving the default.

The PIDKEY Value is your key for SharePoint, so you’ll enter 25-character license key here. This is required!

Don’t worry about the terminology in this file, such as “spswfe” or SERVERROLE Application. These will not determine your server roles and don’t need to be changed. To find out more about what can be configured here, check out the TechNet article here.

For my install, I’ve kept all the defaults and just added my 25-character license key for “PIDKEY Value”.

Office Web Apps

The “config-OWA.xml” contains the configuration options for Office Web Apps. It replaces the “config.xml” files in the OfficeWebApps folder (under the Setup sub-folder). This is similar to the file above. You must edit this with your license key, just like config.xml. So, I’ve updated this file with my 25-character license key for PIDKEY Value and kept all the other defaults.

AutoSPInstaller Configuration

Recently, the configuration file for AutoSPInstaller has matured and is now heavily commented. So, I won’t go through all of the options but I’ll highlight a few of them here.

Before we get to that though, let me explain how this works. When you’re ready, you’ll launch AutoSPInstaller using the “AutoSPInstallerLaunch.bat” batch file. The batch file will check for an XML file with the following names, in order:

  • AutoSPInstallerInput-COMPUTERNAME.xml
  • AutoSPInstallerInput-DOMAIN.xml
  • AutoSPInstallerInput.xml

My preference is to use one configuration file for each server in my farm. You can also just use one file but I’ve seen people have problems with this method. So, I’ll make a copy of the file and name it AutoSPInstallerInput-SHARECLOUD.xml

Note: You will not be passing the xml file as a parameter to AutoSPInstaller so you must name it according to one of the options listed above.

So, lets start.

Change this to your environment. I often have Dev, Test, and Prod environments so I like to specify one of those. It’s just here for your personal reference. I’ll change mine to Prod and leave the version alone. The Version is for the version of AutoSPInstaller you’re using. You must use the XML configuration file for the version of AutoSPInstaller being used, don’t mix and match.

true

In my first post, I downloaded the prerequisite files, so I’m going to set this to true.

 {...} 

I’m going to set all of these to true. Although disabling LoopbackCheck isn’t exactly the proper way, adding BackConnectionHostNames is too much work for what I’m doing here, trying to automate. See this article for more information.

The same reasoning applies to CRL Checking and IE Enhanced Security. For me, these do more harm than good but set the options according to your preference.

The principle of least privilege prescribes that accounts should not be given more privileges than necessary. So, why am I setting LeaveInLocalAdmins to true? Two reasons. For me, its too much of a pain to add the Farm account back in every time I do a backup or troubleshoot UPS. Second, and more importantly in this case, I’m using the Farm account for ForeFront which requires local administrator rights.

Alias_SPSQL 

OK, so I do want to create a SQL alias because I always do. I’ve written about this before, here and here. Basically, there are times when you NEED an alias and other times when you don’t. Instead of trying to remember when, I just create one and use a naming convention that tells me its an alias. That way, the next guy won’t be looking for a server name “SPSQL” somewhere on the network.

For DBInstance, you’ll either put the SQL Server name (as I have) when you’re using the default instance, or put the SERVERNAME\INSTANCE when you’re using a named instance or a cluster. I left DBPort blank so that the default port of 1433 will be assigned.

SOPS

Just a note on DBPrefix; by default the XML file has “localhost” which will be changed to the computer name. You’ll probably want to change this. Set it to blank for no prefix. You don’t need to put a separator value here, it will append an underscore ( _ ) automatically. If you want to change that separator value, see this posting for a tip.

The Claims To Windows Token Service (C2WTS) must be started locally on any server where you have a service (such as Excel Services) that will use it. AutoSPInstaller won’t check this for you, so keep that in mind. In my case, I’ll be starting Excel Services on my Web Server (and perhaps Application Server) so I’m setting it to true.

   
	
		COCOLYNN\svc.spapps 
		pass@word1
	
	
		COCOLYNN\svc.spapppool 
		pass@word1
	
	
		COCOLYNN\svc.spmypool 
		pass@word1
	
	
		COCOLYNN\svc.spsearch 
		pass@word1
	

The “CommonName” cannot be changed. AutoSPInstaller uses the names to reference these accounts. I recommend filling in the passwords, you could leave them blank and be prompted for them later but that defeats the automation aspect. I’d rather find another way to secure the configuration file, such as zipping them up with a password or use encryption software.

I want my URLs added to my servers hosts file. In most of my configurations, I’m using a load balancer and I want to avoid directing SharePoint services through it, plus I need to be sure when I’m on the server that it’s using itself. This is especially useful for the crawler (my crawl server is always a web server as well).

20

By default, this parameter is blank which means unlimited. I’m wary of setting anything to unlimited. Since I’m not changing my log location (to something other than the system drive), I certainly need a limit here. Without one, I risk running out of disk space, potentially causing my machine not to boot.


AutoSPInstallerInput.xml is very well commented for this section so I’ll just reiterate some points. First, don’t change the type. In this case, consider the type to mean “first web app.” It doesn’t have to be a portal, in my case it’s just going to be a team site. However, since it is the “first web app,” AutoSPInstaller will take some “nice to have” actions for you. For example, it will add this web app to the Excel Services trusted file location and as a “Portal Site Collection.” If you don’t need it, either comment it out (this section) or just remember to go back in later and delete the web app; that’s the easiest way.

In my case, I do want this as sort of a “root” site and I want it to be SSL-enabled. So I’ve updated the URL and port. The script will try to find the correct certificate and assign it in IIS. It can also create self-signed certificates if no match is found! However, you should check it afterwards and correct it if needed. I believe a limitation in IIS/Certificate PowerShell cmdlets make it impossible to specify a certificate name to assign.

I’m not using Claims. Here’s a tip, if you don’t NEED Claims, don’t use it. If you don’t know if you need it, you don’t. You can always convert to Claims later, but you can’t convert back (not supported).

I will use the same settings for URL, name, etc. in the next section for Site Collection (not shown). That section is also where you specify the template and I’ll change it from the default of SPSPORTAL#0 (Collaboration Portal) to STS#0 (Team Site). For a nice post on templates, including a list of what’s what, check out this blog post.

The same advice applies to the MySite section. Don’t change the type and in this case, also don’t change the Template for the Site Collection.

 

I’m going to provision the User Profile Service (UPS). If you do want to provision this, make sure you’ve created your My Site Host earlier. If you don’t, the script will error out. I’ve left the defaults of starting UPS Sync and not creating default sync connections. I recommend not automating the sync connections because its far from perfect and unsupported:

Please note that these cmdlets are only intended for use within SharePoint Online environments by SharePoint Online engineers. Their use in on premises deployments is NOT supported.

That’s taken from Spence Harbar’s (@harbars) post on the topic.


    

I’m going to make this server a Crawl and Query server as well. I can always change the topology later. Remember, anywhere you have “localhost,” it will be changed automatically to the local server name.


In the OfficeWebApps section, I’m setting Install to true and will also provision all of the Office Web Apps to true as well, EXCEPT Excel. I’ve already created an Excel Service app, you don’t need two unless you just really want two. For this and any other service, follow the capacity planning guidance available on TechNet.

I’ve skipped over a lot of settings because I believe they need no further explanation. Here’s a copy of the AutoSPInstallerInput configuration file I’ve configured, with the comments removed for easier readability. Click the arrow to expand.



    
        config.xml
        true
        
            true
            true
            true
            true
        
    
    
        pass@word1
        
            COCOLYNN\svc.spFarm
            pass@word1
            helpdesk@cocolynn.com
        
        
            AdminContentDB
            7777
            true
        
        
            Alias_SPSQL
            
            SOPS
            Config
        
        
            
            
            
            
            
                SHARECLOUD
                helpdesk@cocolynn.com
                spadmin@cocolynn.com
            
        
        
            
                COCOLYNN\svc.spApps
                pass@word1
            
            
                COCOLYNN\svc.spAppPool
                pass@word1
            
            
                COCOLYNN\svc.spMySitePool
                pass@word1
            
            
                COCOLYNN\svc.spSearch
                pass@word1
            
        
        
            COCOLYNN\svc.spCacheUser
            COCOLYNN\svc.spCacheRead
        
        
            
                
            
            
                
                20
                
                
            
            
                
                
                
            
        
    
    
        
            
                
            
            
                
                
            
        
        
            
                
                
            
            
                
                
            
        
    
    
        
            Metadata
        
        
            Profile
            Sync
            Social
        
        
            
                
                    
                    
                        
                    
                    
                        
                    
                    
                        
                    
                    
                        
                        
                    
                    
                        
                    
                
            
        
        
            StateService
        
        
            WebAnalyticsReporting
            WebAnalyticsStaging
        
        
            UsageAndHealth
        
        
            SecureStore
        
        
            BusinessDataCatalog
        
        
            WordAutomation
        
    
    
        
        
        
        
        
        
        
            PerformancePoint
        
    
    
        
        
        
        
        
        
    
    
        
        
        
    
    

Almost done. It’s common for typos and syntax errors to pop up because the XML file is so long and has so much information. We need to run it through a validator. So, head over to http://www.w3schools.com/xml/xml_validator.asp and paste your entire XML in the validator.

No errors? Now, we’re ready to go! In the next post in this series, I’ll show you how to run this and how it looks as it progresses.

Service Accounts

As a reference, here are the service accounts I’ll be using and what they get assigned using the default options in the XML configuration file.

CommonName or

XML Node

Account

Notes

spservice svc.spApps

(Managed Account)
Runs following services:

  • SharePoint 2010 Tracing
  • SharePoint 2010 User Code Host
  • Web Analytics Service

Runs IIS App Pools:

  • PowerPoint
  • Access Data Server
  • Word Server
  • Conversion Service
  • Excel Calculation Server
  • Managed Metadata
  • PPS Monitoring Server
  • Visio Graphics Server
  • Web Analytics
  • Secure Store
  • BDC
portalapppool svc.spAppPool

(Managed Account)
Runs IIS App Pool for Portal Web Application.

Site Collection owner for Portal site (by default).
mysiteapppool svc.spMySitePool

(Managed Account)
Runs IIS App Pool for MySite Web Application.

Site Collection owner for MySite host (by default).
searchservice

and

<EnterpriseSearchServiceApplication>

svc.spSearch

(Managed Account)

Runs following services:

  • SharePoint Server Search 14
<SuperUser> svc.spCacheUser Full Control User Policy on Portal Web Application (and other Web Apps you create).
<SuperReader> svc.spCacheRead Full Read User Policy on Portal Web Application (and other Web Apps you create).
<Farm> svc.spFarm Runs the following services:

  • SharePoint 2010 Timer
  • Forefront Identity Manager Service
  • Forefront Identity Manager Synchronization
  • Microsoft Forefront Server Protection Controller for SharePoint

Runs IIS App Pool for:

  • Central Admin Web App
  • Topology Service
  • STS for each Web App (CA, Portal, Mysite)
  • STS Service
<EnterpriseSearchServiceApplication> svc.spCrawl Default Content Access account will be used under Search Service Application.
<EnterpriseSearchServiceApplication> svc.spSearchPool Runs IIS App Pool for Search Service.
<EnterpriseServiceApps> svc.spUnattend config’d in Secure Store?
<EnterpriseServiceApps> svc.spPerfPoint
Not Configured in Script LocalSystem Run the following services:

  • SharePoint 2010 Administration
  • SharePoint 2010 VSS Writer
  • SharePoint Foundation Search V14 (Disabled)
  • Office Document Conversions Launcher (Disabled)
  • Office Document Conversions Load Balancer (Disabled)

And as a reminder, although I don’t mind answering questions or responding to comments on my blog, if you have specific questions related to AutoSPInstaller, its best to use the discussion boards there: http://autospinstaller.codeplex.com/discussions

12 comments

AutoSPInstaller: Getting Prepared

SharePoint, Windows PowerShell, CodePlex
This entry is part 1 of 4 in the series AutoSPInstaller

This post will focus on how to get started with AutoSPInstaller. Along the way, I’ll write some tips that I’ve learned and hope to give readers some more details on how to most effectively use AutoSPInstaller. Tobias Lekman (@tobiaslekman) also has a step-by-step guide on his blog here.

AutoSPInstaller is a CodePlex project started by Brian Lalancette (@brianlala). The aim of the project is to provide a set of unified scripts to install SharePoint by following best practices. You can find more on the project by visiting http://autospinstaller.codeplex.com/

Assumptions

  • You have at least one SQL Server (or cluster) up and running that will be used for the SharePoint databases.
  • You have a Windows Server 2008 R2 server up and running. The server is joined to your domain, has network connectivity and the firewall is turned off. No pre-requisites, server roles, or features are installed yet.
  • You have access to a file share (could be a local drive) where we’ll stage the software.
  • You have (at least) SharePoint 2010 Foundation. In this example, I’m going to use Enterprise edition and additional software such as Office Web Apps. These are not required though.

Scenario

  • I’m going to install SharePoint using AutoSPInstaller and my locale is en-US (United States).
  • My SQL Server name is SQL2008R2 and I have a default instance installed (MSSQLSERVER).
  • My SharePoint server is called SHARECLOUD and I have set the PowerShell policy to Unrestricted (Set-ExecutionPolicy Unrestricted).
  • My install account is svc.spsetup; always use a common install account. This account is a local administrator on my SharePoint server(s).
  • My file share is mapped to the Z: drive, svc.spsetup (my install account) has Full Control.

Preparing the file share

The first step is to prepare the file share.

Step 1. Extract AutoSPInstaller:

I’m going to start with AutoSPInstaller. Download a copy from http://autospinstaller.codeplex.com and extract the files to your file share.

image

Step 2. Copy SharePoint bits:

Once extracted, AutoSPInstaller gives you the proper folder structure. You have to stick to this because the scripts use relatives paths (for example: ../../xyz.exe) in many places.

So now, I’m going to take a copy of my SharePoint DVD or extract the contents of my SharePoint ISO to the SP2010\SharePoint folder, as shown here:

image

Tip: If you have an ISO, consider using 7-zip to extract its contents.

Step3: Tweak Windows settings (optional)

I do this to prevent pop-ups regarding untrusted locations. Without this, your install can’t really be unattended because you’ll have to click Continue (or Cancel) when the warning for Open File Security shows up. This happens when you copy files from the internet (as we’re doing with the AutoSPInstaller scripts) or from file shares, even a DVD (as with the SharePoint bits).

  • First, make sure you are logged in as the setup account. This is a user-based setting. Click Start –> Run –> gpedit.msc –> Press Enter or OK
  • Browse to User Configuration –> Administrative Templates –> Windows Components –> Attachment Manager –> Inclusion list for low file types.
  • Add .exe;.ps1;.bat to the list, as shown.
image

Step 4. Copy SharePoint Prerequisites:

Since I may be installing a large farm, I don’t want to keep downloading the prerequisites each time. I want to keep a copy of the files and use the offline installation method (faster).

I’m going to go back to http://autospinstaller.codeplex.com and click on the Downloads tab. On the right-hand side, under "Other Downloads" there’s a script to download all the prerequisites. Download and save that somewhere. I choose to put it in the SP2010\SharePoint folder.

image

Now run the PowerShell script. It will ask for a folder, I’ve specified current folder in my screenshot. The script will use the existing PrerequisiteInstallerFiles folder or create one if there isn’t any in the folder you specify. This is how it looks while its running.

image

When its done, you’ll see all the files downloaded to the folder you specified. They should be in the SP2010\SharePoint\PrerequisiteInstallerFiles folder.

Step 5: Slipstream Updates

Your media may already have SharePoint 2010 Service Pack 1, mine doesn’t so I’m going to slipstream it. I’ll also slipstream the latest cumulative update (CU) that I’ve tested. Find out more information on SharePoint 2010 at the Update Resource Center.

First, I need to download the update for SharePoint Server 2010 (link). I’ll save this to my desktop (or a temp folder). Next, I’m going to grab the CU, which should be optional and is intended to fix an issue you’re experiencing. However, this statement posted on the KB for Service Pack 1 encourages installing a CU:

"After you install SharePoint Foundation 2010 SP1 or SharePoint Server 2010 SP1, you must also install the corresponding June 2011 Cumulative Update refresh package."

As of this writing, the latest is the October 2011 CU. However, this contains regressions that I don’t want to deal with. For a list of known regressions, Todd Klindt (@toddklindt) has been keeping track on his blog: http://www.toddklindt.com/blog/Regressions/Home.aspx

I’m going to go with the August 2011 CU. This also means that I don’t need two packages (one for SharePoint Foundation and one of SharePoint Server). Prior cumulative updates required both packages. So, the August CU is available here, lets download that to the desktop as well.

In a command prompt, I’m going to type in the following:

officeserver2010sp1-kb2460045-x64-fullfile-en-us.exe /extract:Z:\SP2010\SharePoint\Updates

Then:

office2010-kb2553048-fullfile-x64-glb.exe /extract:Z:\SP2010\SharePoint\Updates
image

If you’d like a walk through, Todd Klindt comes to the rescue again. View his blog post here: http://www.toddklindt.com/blog/Lists/Posts/Post.aspx?ID=295

Step 6: Download Adobe PDF iFilter (optional)

I want to be able to search and index PDF files so I’ll need the Adobe PDF iFilter. AutoSPInstaller can set this up for me. I just need to do a couple things to prepare.

  • First download the iFilter zip from here and place it in the SP2010\PDF folder.
  • Second, download the PDF icon from here and place it in the same folder. Rename it to icpdf.gif

UPDATE: Brian informed me that the PDF function in AutoSPInstaller will do all of this for you. So, if you want the PDF stuff, just enable it in the configuration. There are no preparatory steps needed.

Step 7: Extract Office Web Apps (optional)

If you’d like to install Office Web Apps, download and extract the installation to the SP2010\OfficeWebApps folder. Office Web Apps is generally available to enterprise customers, you can’t just go online somewhere and download it, so if you’re interested talk to your Microsoft licensing representative.

Here, I’ve downloaded the Office Web Apps installer to my desktop and am extracting it to the SP2010\OfficeWebApps folder.

en_office_web_apps_x64_517488.exe /extract:Z:\SP2010\OfficeWebApps
image

Since I’m installing Service Pack 1 for SharePoint, I need SP1 for Office Web Apps too. I downloaded it from this site, and extract it to the “Updates” folder under SP2010\OfficeWebApps.

wacserver2010sp1-kb2460073-x64-fullfile-en-us.exe /extract:Z:\SP2010\OfficeWebApps\Updates

Step 8: Extract Forefront Protection 2010 for SharePoint (optional)

Similar to Office Web Apps, you may not have this or may chose not to use it. SharePoint can use anti-malware software from several vendors. In this case, I’ve downloaded Forefront Protection 2010 for SharePoint to my desktop and am extracting it to the SP2010\ForeFront folder. It’s an ISO in my case, so I’m using 7-zip to extract it. That gives me the setup file. I still need to extract that so, in the command line I type in:

C:\Users\svc.spsetup\Desktop>FOREFRONTSHAREPOINTSETUP.EXE /extract:Z:\SP2010\ForeFront
image

Step 9: Slipstream Language Packs (optional)

I saved this for last because it can be complex and there are a couple ways to do this. However, I’m going to show you my preference. I like this method because it ensures that Service Pack 1 for my language packs also get installed properly.

For my example, I’m going to use French and Spanish language packs. To make things easier, I’m going to use another CodePlex project. The SharePoint 2010 Language Pack Downloader here. I simply select my languages and the folder.

image
  • I’ll download the original language packs for each language I want and then download the service pack for each of those.
  • Next, I need to extract them to a subfolder that I’ll create. The subfolder will be named for the "Culture Short Code" of the language. For a list of culture short codes see this MSDN article.
For example: SpanishLanguagePack.exe /extract:Z:\SP2010\Language Packs\es-es
  • Finally, I need to extract the service pack for each language into the "Updates" folder for that language pack.

For example:

SpanishLanguagePack_SP1.exe /extract:Z:\SP2010\LanguagePacks\es-es\Updates

Here’s how my four commands look:

image

For now, we’ve accomplished our goal of preparing our file share. From here, we have everything ready to install a single server or 10 servers, in the same farm or multiple farms. Our SP2010 folder is now over 4 GB.

In the next post in the series, we’ll continue by configuring several files that will help automate our SharePoint deployment.

And as a note, although I don’t mind answering questions or responding to comments on my blog, if you have specific questions related to AutoSPInstaller, its best to use the discussion boards there: http://autospinstaller.codeplex.com/discussions

I do respond there and so do others, so your chances of getting an answer, more quickly are greater.

4 comments

SPC11: Enterprise Deployment of User Profile Service

SharePoint

Spence Harbar discussed the User Profile Service and considerations for Enterprise Deployments. Right off, he stated that the MCM class spends 6 hours on UPS! Certainly, 90 minutes is not sufficient to cover everything but I took some notes that you’ll find in this article.

Spence spoke about Identity Management as a key foundation for UPS and the fact that it’s a very political topic (10% technology, 90% business/politics). To help ensure a good identity management foundation exists, we need to answer some key questions:

  • Ownership: Who owns the data? Where’s the authoritative source?
  • Data Quality: Does the data exist? Is it up to date and accurate? Is it compliant?
  • System Quality: What’s the health of systems managing the data (AD Health?)
  • Access: How do you authenticate and access the systems managing identity data.

Tip: Be friendly to your directory services management team. You’ll need coordination, communication, and change control.

Architecture

There are 3 related databases for user profiles:

  • SocialDB: This holds things like tags, notes, and ratings.
  • ProfileDB: Hold the profile data for users and the organization and activity feeds. Should grow very large if your SharePoint deployment is focused on social networking.
  • SyncDB: Hold configuration and staging information for synchronization data.

The User Profile Application (UPA) talks directly to SQL, this is why it’s not supported over the WAN (as a federated service).

SharePoint includes FIM “light,”  provisioning UPS Service Instance is effectively installing and configuring FIM.

Tip: The SyncDB is a temporary holding area for synchronization data. Deleting (and re-creating) it should not be an issue. All the important (actual) data is stored in the other two related databases, SocialDB and ProfileDB.

Provisioning

Using Central Administration for provisioning UPS is not recommended. Using PowerShell for UPA provisioning provides more options, control and provides a repeatable process (since issues could easily arise). However there are some limitations or problems when using PowerShell to create the User Profile Application.

Limitations:

When using PowerShell to create the UPA, there is a Default Schema issue. The Farm Account default schema is set incorrectly in Sync DB, UPS will never start under this case. Because the user is logged in as the server administrator, that account will be dbo (rather than the Farm account).

Workarounds

  1. Log on to machine as Farm Account and under UAC elevation run the PowerShell to create UPA; not recommended.
  2. Fix default schema manually (not supported) using SQL Server Management Studio or TSQL; not recommended.
  3. Best method is to start PowerShell process using RunAs, pass the Farm Account credentials, and run the PowerShell script to create UPA. Essentially, you’re running a PowerShell script from a PowerShell script. AutoSPInstaller uses this method (I believe). See Spence’s post here for details: http://www.harbar.net/articles/sp2010ups.aspx

Deployment Guidance

Planning is paramount! Define what properties you’ll need and how “social” features will be used in your organization. Plan, plan, plan.

Ensure the data is accurate (remember: garbage in, garbage out) and ensure systems managing the user directory are healthy. Consider using Microsoft services to deliver an Active Directory Risk Assessment (AD RAP) when deploying large scale social deployment.

Design Constraints

You can only have one UPS Service Instance per Service Application. “Effectively replaces the Index role (from MOSS 2007) as the single point of failure.” The only way to get high-availability (HA), is to start UPS on another machine (will automatically un-provision on first machine).

Keep in mind that you cannot log ship Sync DB (its unsupported – see this article for other databases that cannot be log-shipped). Clustering is the only option to get some level of high availability. Since the Sync DB is just a temporary staging environment, you can easily create a new UPA and use your existing Profile and Social DB with no data loss.

Deploy Sync DB on dedicated SQL instance (it loves RAM) to get best sync time for large number of users.

MySites

  • MySite Host can only be in a single language. Recommend using primary language of your organization. Only the default will be used for phonetic matching during search.
  • Pre-creating MySites is not recommended, you’ll end up with tons of empty or unused site collections. Its very unlikely that every user will try to create a MySite during the launch of your new SharePoint Farm.
  • Limit the profile properties you want to manage, it can add too much complexity and unnecessary load. Get the important things but don’t go overboard.
  • Using the full version of FIM to change configuration settings with SharePoint puts your in unsupported state.
  • You can use distributed MySites by creating multiple farms and  a UPA in each Farm. Each MySite is added to Trusted MySite Locations. Audiences are used to redirect users to correct host. Multiple UPAs in a single Farm is not supported.

Considerations for Claims

The following are some considerations when using a SharePoint Farm in Claims-mode:

  • Audiences can only be property based. No groups.
  • Mapping to claims user requires manual configuration. FULL Sync required after configuration.
  • You’ll need custom code for people picker to work as expected.
  • Outlook Social Connector is Windows authentication only.

Tip: Deploy Service Pack 1 and the June 2011 Cumulative Update (CU) for SharePoint 2010 as these provide enhancements related to the User Profiles.

Service Pack 1 provides many enhancements including the following:

  • Activity feed enabled by default
  • Performance increase during synchronization
  • Organization Browser fixes
  • Customized security trimming

In addition, the June 2011 CU provides enhancements including the following:

  • A 33% performance improvement during sync
  • Improved ULS logging

Major Farm Lifecycle Events

Finally, Spence addressed some consideration for major farm lifecycle events (such as upgrades, updates, and backups). For example, installing a Cumulative Update (CU) requires re-provisioning of UPS. There is no “pause” method for UPS and PSConfig is not aware of Sync DB. Therefore,  schema updates are taken care of during UPS provisioning.

UPS is stopped before a backup occurs and requires re-provisioning with many 3rd party backup solutions. Farm account must be a local admin during provisioning. If not, it will not provision (correctly).

Maintaining databases is important, however be careful. The SyncDB can become large, don’t use TSQL to fix – it’s unsupported. Spence mentioned there are scripts on the interwebz that show you how to do this but remember, they are unsupported. So, what can you do?

Just throw away UPA and recreate, use existing ProfileDB and SocialDB, no data loss incurred.

Conclusion

This was truly a 400-level session and there was much too much information to consume and regurgitate! I hope I’ve captured some key points and hope this is helpful. Spence did say that TechNet is an excellent resource. In addition, visit Spence’s blog and the resources listed here:

0 comments

SPC11: AlwaysOn in SQL Server Denali and SharePoint

SharePoint

This is a cross-post of my article on SharePointEduTech.

Bill Baer (@williambaer) gave an excellent presentation on the next version of SQL Server, codenamed Denali that will feature AlwaysOn. AlwaysOn is a new high-availability solution for SQL Server.

AlwaysOn provides both database and instance level protection. So how does AlwaysOn provide an “integrated, flexible, solution?”

There are 2 components for AlwaysOn:

  1. Availability Groups (database protection – like resource groups in clustering) which includes active secondaries (where you can read data).
  2. FCI (Failover cluster instances) – Provides instance level protection.

AlwaysOn is cost effective because the secondary can be used for backups, reporting, active farms that provide read-only content, etc (any read only operation).

Requirements:

  • Must have Windows Failover Cluster service enabled (for distributated state, and inter-node health detection). SQL boxes don’t have to be clustered.
  • Must be joined to the same AD domain andd use a domain account to create the failover cluster.
  • KB 2494036 hotfix is recommended for Windows 2008 R2. (allows a specified node to have more votes/weight than another node).
  • SharePoint Server 2010 with Service Pack 1

Pre-requisistes:

  • Server instances must reside on Win Server Failover Clustering, must all be in the same cluster
  • Must use same SQL Server system collation (SharePoint has restrictions that comply with this already).

Availability Group

  • Essentially combines log shipping and database mirroring.
  • Compression & Encryption built-in
  • Multiple secondaries
  • Synchronous and Asynchronous
  • Automatic or manual failover
  • Automatic Page Repair (can ask Secondary for copy of page if torn)

With AlwaysOn, connections are re-tried (instead of failed) when there is a failover.

My notes:

AlwaysOn can span subnets so content can be replicated and used elsewhere on a read-only secondary (such as high I/O backups). Roles can be changed manually or automatically, without reconfiguration. This means, no DNS changes or changing connection strings.

Easy transition from either database mirroring or log shipping to AlwaysOn; just a few minor configuration changes.

A flexible failover policy allows control over the condition when a failover should be initiated. This will prevent false failovers. There’s also increased detail in logging that will allow admins to determine why a failover occurred.

AlwaysOn provides the best RTO and RPO, over Failover Clustering, Log Shipping and Restore from backup.

Learn more about SQL Server High-Availability and AlwaysOn on microsoft.com.

0 comments

Roundup: SharePoint Warm-Up Scripts

SharePoint

This is a cross-post of my article on nbsp.

Harry Chen did a comparison of SharePoint Warm-Up scripts in October 2010, this is essentially a follow up to his findings. At the end, I’ll share the script that I’m using. Do we really need another SharePoint Warm-Up Script? No, but I found some useful, others not so much and decided to modify one for my needs.

First, lets describe briefly what these scripts are and their benefit. During normal operation, IIS will recycle application pools, this is normally done once per day. An IISRESET or computer restart will recycle application pools as well. When this happens, there is a significant performance hit when loading a web site for the first time because everything needs to be compiled.

A Warm-Up Script essentially loads one or more webpages so that Just-In-Time (JIT) compilation is performed. The idea is to "warm up" the site before users start requesting it so they don’t suffer that first time hit. More info here.

With that said, this isn’t useful for SharePoint Farms with large numbers of users access SharePoint all day and night. It’s probable a user will get that first hit before your script does. However, for smaller Farms or where there is a usage profile (e.g., 9am to 5pm), this can be useful. It could also be useful for development environments or demo machines where you just need to warm up ahead of time.

Now, let’s take a look at some of the options I found. CodePlex had a few solutions:

  • SPWakeUp – This is an exe file that takes a few parameters. It can exclude site collections you specify, send an email log of results and you can specify a username/password. As an IT Pro, I just don’t like compiled programs/scripts even if the source code is available because its hard to modify if I need to.
  • SPSiteWakeUp – This is similar to SPWakeUp but what’s cool here is that it can run as a Windows Service.
  • PSWarmUp – This is a bundle of PowerShell files, a batch file to start up and some configuration files. For me, this one just seems unnecessarily complex. There’s a configuration file with not much in there and a few temp files get created for the script. It’s also unnecessarily hitting all sites in all zones. I like that is based on PowerShell but it still uses good ‘ole stsadm.exe.
  • SharePoint WarmUp Tool – This last one on CodePlex seems unfinished. The source code is there but there is no compiled version so you’ll have to compile yourself. However, this is the only script I’ve found so far that claims (it will) work with Claims and FBA. Still, I’m not too sure I like compiled scripts for this purpose. Alternatively for FBA, here’s a sample.

There are also several on the blogosphere. You may find variations of these scripts on other blogs (besides the ones listed here). However, I tried to make sure I captured the one which was the source (there’s so much plagiarism going on!!).

  • WarmupServer (Joel Oleson 2006) – Joel does not take credit for writing these scripts but does a good job of explaining what they do. This is a set of vbs and batch files. This one is really old (from 2006) and requires a lot of customization. I wouldn’t touch it.
  • Daniel Bugday SharePoint 2010 Warmup Server Script – Also vbs based and uses stsadm.
  • Kirk Hofer’s SharePoint Warm Up Script (2008) – This was originally created for MOSS 2007 but should work on SharePoint 2010 as well. It enumerates all zones and sites and loads each one. It still uses stsadm.exe. What I didn’t like about this one is that it wasn’t easy to configure. In MOST cases, there’s no use "warming up" different zones because they are all contained in the same application pool. However, this PowerShell based script is small and easy to use! (Another variation here to allow specifying additional sites and here for a simpler version).
  • Ingo Karsteins SharePoint Warm Up (2011) – This is a PowerShell based script, similar to Kirk Hofer’s. It includes the ability to set a timeout and does some Windows Event Logging (which I thought was cool). About half way down, there is a parameter called $urls that needs to be defined. This is really the only thing I didn’t like about this script – where the parameter is located and the fact that you have to define it.
  • Andrew Connells Site Collection Keep-Alive Job – This is a solution file (WSP) for SharePoint. Frankly, this is probably the best implementations of warming up sites. You can specify how often to ‘refresh,’ which web applications, sites, and sub-site as well. All in a friendly Central Administration GUI.

Finally, there used to be an IIS Application Warm-Up module. It’s officially retired, if you see it somewhere else, don’t use it. I never did get it to work for SharePoint 2010 anyway.

OK, at long last, what am I proposing? I like components of Ingo Karsteins and Kirk Hofer’s script, so I’m going to combine them. I wanted to avoid using stsadm and I wanted to keep it simple (one file). I also did some testing on warming up individual site collections and found that it really was unnecessary. Once the application pool is warmed up (by hitting the web application URL), there’s no significant benefit to hitting the site collections within it.

Modifications:

  • Put the variables on top
  • Loads the SharePoint Snapin so you can run it from a regular PowerShell window
  • Automatically retrieves all of the Web Applications by default and loads them. Optionally, you can uncomment the $urls variable at the top and specify only the ones you want.
  • Uses Get-SP* cmdlets instead of stsadm.exe

Here is the script, a slightly modified version of Ingo Karstein’s script:

#############################################
# Title: Warmup-SPSites.ps1		
# Author: Ingo Karstein: http://ikarstein.wordpress.com/2011/08/03/sharepoint-warm-up-now-with-timeout/					
# Modified by: Wahid Saleemi
# Twitter: @wahidsaleemi					
# Reference: https://wahidsaleemi.com	
#############################################

#Region Define Variables
### Setup your variables here
$timeout = 60000 #=60 seconds
# Leave the line below commented if you want all of the Web Apps. Uncomment and set for only specific ones.
#$urls= @("http://finweb", "http://another.sharepoint.local")
#EndRegion
 
#Region Load SharePoint Snapin
$ver = $host | select version
if ($ver.Version.Major -gt 1)  {$Host.Runspace.ThreadOptions = "ReuseThread"}
Add-PsSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
#EndRegion
 

#Region MyWebClient
    Add-Type -ReferencedAssemblies "System.Net" -TypeDefinition @"
    using System.Net;
    public class MyWebClient : WebClient
    {
        private int timeout = 60000;
         public MyWebClient(int timeout)
        {
            this.timeout = timeout;
        }
         public int Timeout
        {
            get
            {
                return timeout;
            }
            set
            {
                timeout = value;
            }
        }
         protected override WebRequest GetWebRequest(System.Uri webUrl)
        {
            WebRequest retVal = base.GetWebRequest(webUrl);
            retVal.Timeout = this.timeout;
            return retVal;
        }
    }
"@
#EndRegion
 
#Region Function to get Site List
Function Get-SiteList {
$script:sitelist = "$env:temp\siteURLs.txt"
New-Item $script:sitelist -itemType File -Force | Out-Null
# To WarmUp, we really just need the load the Web Apps
$sites = Get-SPWebApplication -IncludeCentralAdministration | Select Url
# If we want to try some caching too, get all the site collections, comment above and uncomment below
# $sites=Get-SPSite -Limit ALL
foreach ($site in $sites) 
	{
		#write-host $site.Url;
		$site.Url | Out-File $script:sitelist -append
	}
}
#EndRegion

#Region Set URLs to WarmUp
# check to see if a variable $urls is set.
if (!(test-path variable:\urls))
	{
	Get-SiteList
	$urls = (Get-Content $script:sitelist)
	}
#EndRegion

#Region Perform the WarmUp
New-EventLog -LogName "Application" -Source "SharePoint Warmup Script" -ErrorAction SilentlyContinue | Out-Null

$urls | % {
    $url = $_
    Write-Host "Warming up $_"
    try {
        $wc = New-Object MyWebClient($timeout)
        $wc.Credentials = [System.Net.CredentialCache]::DefaultCredentials
        $ret = $wc.DownloadString($url)
        if( $ret.Length -gt 0 ) {
            $s = "Last run successful for url ""$($url)"": $([DateTime]::Now.ToString('yyyy.dd.MM HH:mm:ss'))"
            $filename=((Split-Path ($MyInvocation.MyCommand.Path))+"\SPWarmUp.log")
            if( Test-Path $filename -PathType Leaf ) {
                $c = Get-Content $filename
                $cl = $c -split '`n'
                $s = ((@($s) + $cl) | select -First 200)
            }
            Out-File -InputObject ($s -join "`r`n") -FilePath $filename
        }
    } catch {
          Write-EventLog -Source "SharePoint Warmup Script"  -Category 0 -ComputerName "." -EntryType Error -LogName "Application" `
            -Message "SharePoint Warmup failed for url ""$($url)""." -EventId 1001
 
        $s = "Last run failed for url ""$($url)"": $([DateTime]::Now.ToString('yyyy.dd.MM HH:mm:ss')) : $($_.Exception.Message)"
        $filename=((Split-Path ($MyInvocation.MyCommand.Path))+"\lastrunlog.txt")
        if( Test-Path $filename -PathType Leaf ) {
          $c = Get-Content $filename
          $cl = $c -split '`n'
          $s = ((@($s) + $cl) | select -First 200)
        }
        Out-File -InputObject ($s -join "`r`n") -FilePath $filename
    }
}
#EndRegion

$script:sitelist | Remove-Item -force -ErrorAction SilentlyContinue

Keep in mind, you should run this on all Web Servers that users will access (needs to run on each WFE) and the account running the script should have appropriate permissions.

If I missed a Warm Up script that’s really different from the ones in this article, please leave a comment!

4 comments