Saturday, September 14, 2013

Build a SharePoint Server 2010 Two-Tier Dev Environment on Windows 2008 R2


This posting walks you through the process of building a simple two-tier SharePoint Server 2010 development and testing environment on Windows 2008 R2 and using VMware Workstation 7.X.  It will involve six steps: build servers, configure DC & DNS, join domain, install SQL Server, Install SharePoint Server, Configure SharePoint Server and Configure DNS.  Procedures are also provided for several optional steps: Install SharePoint Designer and Install AdventureWorks Lab Environment.  Aside from VMware Workstation, all other software can be obtained without cost as freeware or trialware.

Step 1: Build Servers
  • Build two Windows Server 2008 R2 SP1 instances.
  • Though the clone template sets RAM at 2 GB, 1.5GB works fine with no noticeable decline in performance.
Step 2: Configure DC and DNS
  • On first server (and in this order!):
    1. Set computer name: spdev11.
    2. Configure network adapter IP address.
    3. Configure DNS to point to ISP DNS.
    4. Add role: Active Directory.
    5. Add role: DNS.
    6. After completion, verify that new forward lookup, pointing to this DNS, was automatically created.
    7. Configure PDC emulator to synchronize time with the Windows time service:
    8. Perform Best Practices scans on the DC and DNS roles to check for any significant issues:
    9. Add domain accounts: sp_admin, sp_web, sp_app.
Step 3: Join Domain
  • On second server:
    1. Set computer name: spdev12.
    2. Configure network adapter IP address.
    3. Configure DNS to point to own DNS.
    4. Join to domain.
Step 4: Install SQL Server 2008 R2
  1. Point VM CD/DVD drive to SQL Server ISO.
  2. Launch installation.
  3. Create shared folder to host: service packs folder.
  4. Install Service Packs 1 & 2.
  5. Add account sp_admin:
    • Add roles: dbcreator, securityadmin.
  6. Add own account as sysadmin.
Step 5: Install SharePoint Server 2010
  1. Create shared folder to host: installation folder.
  2. Verify all prerequisites in PrerequisiteInstallerFiles folder.
  3. Verify PrerequisiteInstaller.Arguments file.
  4. Launch PrerequisiteInstaller.exe.
  5. Launch setup.exe.
  6. After completion of setup, and the appearance of the Product Configuration Wizard, continue to next step.
Step 6: Configure SharePoint Server 2010
  1. Continue the SharePoint Products Configuration Wizard.
  2. Connect to a server farm: Create a new server farm.
  3. Specify Configuration Database Settings.
    1. Database Server: spdev11.
    2. Database name: default.
  4. Specify Database Access Account.
    • Username: contoso\sp_admin.
  5. Specify Farm Security Settings.
    • [configure as desired].
  6. Configure SharePoint Central Administration Web Application.
    1. Specify port number: enabled: 2000.
    2. Configure Security Settings: ntlm.
    3. Service account: sp_app.
  7. When prompted to create a new web application and site collection, choose No.
  8. Check server Application and System logs and resolve common errors:
    1. Error 8193.
    2. Error 7043.
  9. Install SharePoint Server 2010 Service Packs (order is important):
    1. Install Foundation SP1.
    2. Reboot.
    3. Install Server SP1.
    4. Reboot
    5. Run Configuration Wizard.
    6. Install Foundation SP2.
    7. Install Server SP2.
    8. Reboot.
    9. Run Configuration Wizard.
  10. Create a team site.
  11. Register managed account: contoso\sp_web:
  12. Configure default website (team site) web application pool to use sp_web.
  13. Reset IIS:
  14. Check site collection administrators:
    1. On the team site, go: Site Actions > Site Settings > Users and Permissions > Site collection administrators.
    2. Verify that the accounts listed here are domain accounts.
Step 7: Configure DNS
  1. Local (host) DNS:
    1. On your local machine, navigate to C:\Windows\System32\drivers\etc\:
    2. Open the HOSTS file in any text editor.
    3. Add entries for the SharePoint Server's DNS settings:
    4. Test these entries by pinging them from the host:
    5. In Central Administration, add alternate access mappings for these entries:
  2. Domain DNS:
    • Add Host (A) records for these entries.
Optional: Install SharePoint Designer 2010 (32bit)
  1. Install SharePoint Designer 2010.
  2. Install SharePoint Designer 2010 SP1 and SP2.
  3. Test by connecting.
Optional: Install AdventureWorks Lab Environment
  1. Attach the AdventureWorksDW for SQL Server 2008 R2 database from CodePlex.
  2. Download the AdventureWorks 2008R2 Analysis Services Project from CodePlex.
  3. Complete the installation procedure as discussed in Exercise 5 of Building a SharePoint 2010 Virtual Lab.  [See note below]
Optional: Install the Northwind Trader Sample Site Collection
  1. Download the Northwind solution package.
  2. Follow Chris Beckett's directions to install the package.
  3. Add the Northwind Trader employees to Active Directory.
Optional: Add Sample Users to Active Directory
  1. Download a sample user list (CSV) from Brian Dunning, and then place it on the server hosting the DC.
  2. Logon to the server hosting the DC (spdev11 for this posting).
  3. Open a PowerShell window.
  4. Create a CSV file containing all of the sample users to be added.  The column headers can have any name, but they must be appropriately referenced in the script.
  5. Run Todd Klindt's simple PowerShell script for importing new accounts; or try other approaches (some are referenced below).  A sample PowerShell script is provided in the Notes below.  New-ADUser scripts must be run under an account with permissions to modify AD.
Optional: Install Visual Studio Trial Versions

This posting has presented a step-by-step walkthrough of how to build a virtual SharePoint Server 2010 environment for development and testing.  All of the software elements can be obtained as freeware or trialware, except for VMware Workstation. 

  • Configuring DC and DNS: configure the network adapter first before adding the DC and DNS roles.  This way, the DNS configuration routine will automatically detect the adapter DNS setting, configure a forward lookup for it, and then change this setting to point to itself.  This will save the effort of creating the forward lookup yourself.
  • SharePoint Designer: before installing, assess whether Office 32-bit or 64-bit is installed.  Install that version of Designer consistent with the Office version already installed. Additionally, complex compatibility issues may occur when using the 64-bit version.  See the references for further discussion on this topic.
  • AdventureWorks: thanks to Critical Path Training for making this procedure available.  Note that the AdventureWorks database must first be downloaded and restored before the solution can be installed.
  • Northwind: thanks and gratitude to Chris Beckett for his efforts in migrating this venerable database to the SharePoint Server 2010 platform.  This solution package includes data only: all database tables have been migrated to appropriately named lists.  No pages have been created. His Northwind solution was installable on SharePoint Server 2010 SP1 (fresh - no CUs) without issue.  This sample content is useful in developing and testing dashboard methods.  Visit his blog at SharePointBits. Note: A File Not Found error may be experienced whilst attempting to implement this solution to the root site collection of a new web application.
  • PowerShell New-ADUser Script: here's a sample script for adding new users in bulk to Active Directory (all on one line):
    import-csv c:\temp\100.csv | foreach-object {New-ADUser -SamAccountName $_.SAMAccountName -UserPrincipalName $_.SAMAccountName -GivenName $_.givenName -Initials $_.Initials -Surname $_.Surname -DisplayName $_.DisplayName -Name ($_.givenName + $_.Initials + $_.Surname) -Description $_.Description -Company $_.Company -StreetAddress $_.StreetAddress -City $_.City -State $_.State -PostalCode $_.PostalCode -OfficePhone $_.OfficePhone -Fax $_.Fax -EmailAddress $_.EmailAddress -AccountPassword (ConvertTo-SecureString "P@ssw0rd" -AsPlainText -Force) -ChangePasswordAtLogon $False -PasswordNeverExpires $True -Enabled $True -PassThru -WhatIf} 
  1. The Local farm is not accessible.  Cmdlets with FeatureDependencyID are not registered.
    1. After setting up the farm using the domain administration account, logged in using regular account provisioned as member of domain admins.  Then attempted to launch SharePoint 2010 Management Shell:
    2. To resolve: launch management shell as Administrator.  Then execute following command: Add-SPShellAdmin [domain\username]
    3. If unsuccessful, logon to the server as domain administrator, then launch the management shell and execute the command.
    4. Note: do not attempt to add the login, roles and permissions manually directly to the SharePoint_Config database, as some have already discussed.  There appear to be other configuration settings affected by this commandlet than just adding logins and configuring roles.
    5. This is what I attempted at first.  Unsuccessful.  I then left the database changes as-is, and then executed the Add-SPShellAdmin, as noted above.  Unsuccessful.  I then removed the changes I had made to the databases, and then re-executed the above commandlet: success.

No comments: