Welcome to part four of my series on how to “Quickly Build a Multi-Server SharePoint 2013 Developer Environment”. In this section I am going discuss how to configure SharePoint servers and prepare our last two VMs. We’ll be using a series of tools to accomplish this, including AutoSPSourceBuilder and AutoSPInstaller (which if you followed the prep from part two you already have downloaded and ready to go). The other thing we are going to do that has been different than the steps done so far is we are going to configure both SP servers and then install SharePoint and configure the farm all at once. To do this we will be using the remote installation option that AutoSPInstaller gives us.
Posts in this series:
- Creating and Configuring the VM
- Configuring the Domain Controller, Active Directory and DNS
- Installing and Configuring SQL Server 2012
- Preparing SharePoint Servers – You are here!
- Creating the AutoSPInstaller Answer File and installing SharePoint
Special note: I like to give credit where it is due. Some of the ideas and code I use in this series come from Vlad’s blog series that you can find here. And a huge thank you to Joanne Klein (@JoanneCKlein) for reviewing and editing the series for me.
Prep the SharePoint App Server
As seen in the previous posts; before we can install anything we first have to configure the server (can’t copy over our files until then). So let’s start off with the following script to allow us to run ps1 files later:
Set-ExecutionPolicy unrestricted
Next run the following script to set the server name, configure network settings, enable remote desktop, disable firewall and a few other things.
#Rename server $serverName = "srv-SP2013App" Rename-Computer -NewName $serverName -force #Configure the Network Adapter $netadapter = Get-NetAdapter -Name Ethernet $netadapter | Set-NetIPInterface -Dhcp Disabled $netadapter | New-NetIPAddress -IPAddress 192.168.0.20 -PrefixLength 24 #Point DNS at the DC Set-DnsClientServerAddress -InterfaceAlias "Ethernet" -ServerAddresses "192.168.0.1" #Rename the network adapter Rename-NetAdapter -Name "Ethernet" -NewName "Internal Network"; #disable the firewall to make communication with SQL a little easier netsh advfirewall set allprofiles state off #Enable Remote Desktop (Get-WmiObject -Class "Win32_TerminalServiceSetting" -Namespace root\cimv2\terminalservices).SetAllowTsConnections(1) (Get-WmiObject -class "Win32_TSGeneralSetting" -Namespace root\cimv2\terminalservices -Filter "TerminalName='RDP-tcp'").SetUserAuthenticationRequired(0)
We also may be using this server for some web traffic so I suggest we disable that annoying IE Security
#Disable IE Enhanced Security Write-Host -ForegroundColor White " - Disabling IE Enhanced Security..." Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A7-37EF-4b3f-8CFC-4F3A74704073}" -Name isinstalled -Value 0 Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A8-37EF-4b3f-8CFC-4F3A74704073}" -Name isinstalled -Value 0 Rundll32 iesetup.dll, IEHardenLMSettings,1,True Rundll32 iesetup.dll, IEHardenUser,1,True Rundll32 iesetup.dll, IEHardenAdmin,1,True If (Test-Path "HKCU:\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A7-37EF-4b3f-8CFC-4F3A74704073}") { Remove-Item -Path "HKCU:\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A7-37EF-4b3f-8CFC-4F3A74704073}" } If (Test-Path "HKCU:\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A8-37EF-4b3f-8CFC-4F3A74704073}") { Remove-Item -Path "HKCU:\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A8-37EF-4b3f-8CFC-4F3A74704073}" } Remove-ItemProperty "HKCU:\SOFTWARE\Microsoft\Internet Explorer\Main" "First Home Page" -ErrorAction SilentlyContinue
It is more likely that we are going to use the WFE for testing with client tools, but just in case, let’s enable the Desktop Experience here too. We’ll reboot the server when we are done:
#Enable Desktop Experience and Reboot Server Add-WindowsFeature Desktop-Experience Restart-Computer
Prep the SharePoint Web Server
The steps here are pretty much exactly the same, but I separated out the scripts as I didn’t want the server names and IP Addresses to get mixed together. As with the App server you need to ensure you can run PowerShell scripts on the server:
Set-ExecutionPolicy unrestricted
Next run the script to configure the basic OS requirements
#Rename server $serverName = "srv-SP2013WFE" Rename-Computer -NewName $serverName -force #Configure the Network Adapter $netadapter = Get-NetAdapter -Name Ethernet $netadapter | Set-NetIPInterface -Dhcp Disabled $netadapter | New-NetIPAddress -IPAddress 192.168.0.30 -PrefixLength 24 #Point DNS at the DC Set-DnsClientServerAddress -InterfaceAlias "Ethernet" -ServerAddresses "192.168.0.1" #Rename the network adapter Rename-NetAdapter -Name "Ethernet" -NewName "Internal Network"; #disable the firewall to make communication with SQL a little easier netsh advfirewall set allprofiles state off #Enable Remote Desktop (Get-WmiObject -Class "Win32_TerminalServiceSetting" -Namespace root\cimv2\terminalservices).SetAllowTsConnections(1) (Get-WmiObject -class "Win32_TSGeneralSetting" -Namespace root\cimv2\terminalservices -Filter "TerminalName='RDP-tcp'").SetUserAuthenticationRequired(0)
Next we want to disable IE Security
#Disable IE Enhanced Security Write-Host -ForegroundColor White " - Disabling IE Enhanced Security..." Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A7-37EF-4b3f-8CFC-4F3A74704073}" -Name isinstalled -Value 0 Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A8-37EF-4b3f-8CFC-4F3A74704073}" -Name isinstalled -Value 0 Rundll32 iesetup.dll, IEHardenLMSettings,1,True Rundll32 iesetup.dll, IEHardenUser,1,True Rundll32 iesetup.dll, IEHardenAdmin,1,True If (Test-Path "HKCU:\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A7-37EF-4b3f-8CFC-4F3A74704073}") { Remove-Item -Path "HKCU:\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A7-37EF-4b3f-8CFC-4F3A74704073}" } If (Test-Path "HKCU:\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A8-37EF-4b3f-8CFC-4F3A74704073}") { Remove-Item -Path "HKCU:\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A8-37EF-4b3f-8CFC-4F3A74704073}" } Remove-ItemProperty "HKCU:\SOFTWARE\Microsoft\Internet Explorer\Main" "First Home Page" -ErrorAction SilentlyContinue
And like the App server, we want to enable the Desktop Experience
#Enable Desktop Experience and Reboot Server Add-WindowsFeature Desktop-Experience Restart-Computer
The next step we are going to do is join the servers to the domain. Run the following script on both servers:
#This script provides the domain and username, but prompts for a password #when joining the domain $domainToJoin = "drevdev"; $loginID = "administrator"; $domainUser = ("{0}\{1}" -f $domainToJoin,$loginID); $adminPWD = Read-Host -Prompt ("Please enter the password for account '{0}'" -f $domainUser) -AsSecureString; $joinCredential = New-Object System.Management.Automation.PSCredential($domainUser,$adminPWD); #Join to domain and reboot after. Add-Computer -DomainName $domainToJoin -Credential $joinCredential -Restart
You can now shut down both VMs and enable your external switch.
Configure for Remote Installations
Next thing we need to do is configure the Web Server to allow the App server to install and configure SharePoint for us. To do this run the following script:
#Enable Credential Security Support Enable-WSManCredSSP –Role Server; #Disable Kerberos and Negotiate Authentication winrm set winrm/config/service/Auth @{Kerberos="false"}; winrm set winrm/config/service/Auth @{Negotiate="false"} #Allow Remote Server Management Configure-SMRemoting.exe -enable
Test to ensure things are configured properly by running the following command from the App server
Test-WSMan srv-sp2013WFE
You should receive a message back similar to the following:
Configure Installation Files
Next let’s prepare the installation files. Do the following steps on the App Server
- Mount the SharePoint installation ISO. If prompted, cancel the setup window.
- Copy over the SharePoint folder to the C: drive of each server.
- Open a PowerShell command window as admin and run the following commands:
cd C:\SharePoint\AutoSPSourceBuilder .\AutoSPSourceBuilder.ps1 -Destination "C:\SharePoint\SP\2013" -GetPrerequisites $true
- The script will copy the binaries to the destination as well as the prerequisites to be used by AutoSPInstaller.
- When prompted for: “Please type the name of an available CU:” enter the CU you wish to download and slipstream and press Enter. At one time there was an issue slipstreaming SharePoint 2013 CUs, but this has since been rectified. If you do not wish to slipstream your build you will need to remove the CU listing from the AutoSPSourceBuilder xml config file.
- Only perform this step if you choose to not slipstream your install with a CU. Do this after or while the source is being built. Download the latest CU that you wish to install in your farm. (https://technet.microsoft.com/en-us/library/dn789211(v=office.14).aspx#BKMK_2013). Unzip the exe and .cab files into c:\SharePoint\SP\2013\Updates
Finally, copy your C:\SharePoint folder from the App server to the C: drive of all of your other SharePoint servers.
That’s it. Everything is ready for you to move to the SharePoint servers and install. Except one thing. We still need to create an AutoSPInstaller answer file.
Click here for the next post in this series: Creating the AutoSPInstaller Answer File and Installing SharePoint
Thanks for reading!
Comments