Script: Set-Cs2013Features.ps1 – Easily Install Prerequisites and Tools for Microsoft Lync Server 2013
Description
This script will assist in getting servers ready for the installation of Microsoft Lync Server 2013 on Windows Server 2012. This includes the operating system prerequisites, SQL Express (where necessary), Silverlight, and more. Some post installation options are also available, and include Microsoft tools such as the debugging tools, the Best Practices Analyzer (BPA), Connectivity Analyzer, and more. Where the script needs files available online, it will automatically download them. More options will be added as I have time, and can properly test. This includes Edge, Director, and Mediation server prerequisites, and more tools. If you have suggestions, please feel free to comment below.
The current options are:
1. Director – Installs the OS prerequisites and SQL Express instances required to install this role.
2. Edge – Installs the OS prerequisites and SQL Express instances required for this role.
3. Front End – includes the Operating System prerequisites, Microsoft Silverlight, as well as the installation of SQL Express SP1 and creation of the various required instances. The SQL Express installs are done because Lync Server installs the RTM version by default. So installing the SP1 version saves a long update later. Note that each instance takes 3-5 minutes to install. Enterprise edition servers have two instances, RTCLocal and LyncLocal, and Standard edition servers also have the RTC instance. See the syntax and example sections below on how to call the script for the two types of servers.
4. Mediation – still being tested to make sure I didn’t miss something.
5. Office Web App – Installs the OS prerequisites required, then installs the Office Web App binaries, and then installs two recent updates. Everything needed to deploy an Office Web Apps server.
6. Persistent Chat - Installs the OS prerequisites and SQL instance required for this role.
7. Lync Server 2013 Resource Kit - tools that make troubleshooting and administrating a Lync environment easier, such as Address Book config, etc.
8. Lync Server 2013 Persistent Chat Resource Kit – tools useful for Persistent Chat environments.
9. Lync Server 2013 Debugging Tools - includes the logging tools such as OCSLogger and Snooper. Helpful for troubleshooting.
10. Lync Server 2013 Stress and Performance Tool – prepare, define, and validate performance
11. Lync Server 2013 Best Practices Analyzer – this tool helps identify any issues from a best practices perspective
12. Lync Server Connectivity Analyzer – identifies any issues that may result in connectivity problems for mobility clients including the Lync Windows Store app
13 Create Shutdown, Logoff, and Restart tiles on desktop – this is a streamlined version of Create a Shutdown/Restart/Logoff Windows 8 Tile for the Start menu (PowerShell) that puts easy to reach Shutdown, Restart, and Logoff tiles on the Start screen. In version 1.1, this was changed from the Start page of the logged on user who runs the script to the desktop and start page of all users.
14. Create scheduled task to automatically update PowerShell help files daily. I discuss this in Function: New-PSUpdateHelpScheduledTask – Auto Update PowerShell Help
15. Launch Windows Update
16. Install/Update Lync Server 2013 Documentation Help
18. Install Microsoft Network Monitor 3.4
19. Add custom Scheduler simple URL – if you’d like to have a simple URL for the scheduler app, such as scheduler.contoso.com, this option will handle the configuration of that. Note that this option requires that the simple URL provided be in the Subject Alternative Names (SAN) list of the certificate on your Front End servers. See Understanding the Lync Web Scheduler for additional info.
20. Install SQL Server 2012 Management Studio
21 Install telnet client
Simply choose your desired option. When the script is finished, it will return to the menu.
Note: The installation of some Lync Server 2013 roles requires some .Net 3.5 components, which are not installed in Windows Server 2012 by default. So the script will need to know where your Server 2012 installation media is. The script defaults to d:, but can be configured for other locations.
The script will also create a log file that can be used for troubleshooting. The log file is created in the same folder that the script is in.
Syntax
C:\Set-Cs2013Features.ps1 [[-TargetFolder] ] [[-Win2012Source] ] [[-SQLPath]] [-WhatIf] [-Confirm]
Examples
Set-Cs2013Features.ps1
This will launch the script with the default options for Enterprise edition servers
Set-Cs2013Features.ps1 -Win2012Source e:
This will launch the script using the e: drive for the source of the Windows Server 2012 installation files
Set-Cs2013Features.ps1 -sqlpath "d:\sqlexpress"
This will install any related SQL Express instances to the specified path
Installation
Execution Policy: Third-party PowerShell scripts may require that the PowerShell Execution Policy be set to either AllSigned, RemoteSigned, or Unrestricted. The default is Restricted, which prevents scripts – even code signed scripts – from running. For more information about setting your Execution Policy, see Using the Set-ExecutionPolicy Cmdlet.
Download
v1.5 – 05-10-2013 Set-Cs2013Features.v1.5.zip
v1.4 – 05-03-2013 Set-CsLync2013Prerequisites.v1.4.zip
v1.3 – 04-29-2013 Set-CsLync2013Prerequisites.v1.3.zip
v1.2 – 04-01-2013 Set-CsLync2013Prerequisites.v1.2.zip
v1.1 – 02-28-2013 Set-CsLync2013Prerequisites.v1.1.zip
v1.0 – 02-08-2013 Set-CsLync2013Prerequisites.v1.0.zip
Changelog
See the changelog for information on what’s changed/included in each version.



Very nice! When will you filling the rest of the options (edge, directer, persistent chat, etc)?
One note, I did notice that the message queueing components aren’t installed during frontend selection;
Add-WindowsFeature MSMQ-Server, MSMQ-Directory
Also maybe a good idea to let the script install .NET Framework 3.5 if it is not already installed in stead of requiring you to mount the Windows Server iso.
Message queueing wasn’t listed in the official MS docs as being a requirement. At least not that I found.
And the reason why the Windows 2012 source files are required is because those files aren’t installed in Windows by default. So the files have to be pulled from the original source.
Very sorry. I checked and indeed it is not a req for the frontend role. I checked in my persistent chat script. Sorry about that.
I don’t know how far you are with the other menu options for the remaining roles but if it could help I could send my scripts for you to review? Would love to see it all consolidated into one script like you have done with the Lync 2010 prerequisites script.
Sure – send them along. My email address is in the comment block of the script.
very nice script, thanks for the share
Pat, what about having the option to specify a local source folder to obtain the files from rather than downloading them? This would be a time saving for people who install Lync often and would have the files downloaded anyway.
Already there. The default target folder is c:\_install. If the file already exists in that folder, then it doesn’t try to download it again. TargetFolder can be specified when you call the script using the -TargetFolder option.
Pat- Great script, noticed that if running on an Edge and trying to install either the Debugging tools or the reskit, it fails on the Visual C++ runtime install. Do you think you could get this added to the script?
Debugging tools already checks for that. I’m adding the check for resource kit. Both should work fine once Lync is installed.
is there a way to specify the drive to install the SQL databases on? Or does it all have to install on the c:\ drive?
Not aware of a requirement that it be on c:. You could edit the script to that it installs it elsewhere.
Hi, great script! I have tested office web app installation, but i think the script is missing the windows features InkandHandwritingServices.
Do you have a link to official documentation saying it’s required?
http://technet.microsoft.com/library/jj219435.aspx
Awesome. Thanks for the info. I’ve added it to the next version of the script, which should get released later this week. TONS of new code in it.
Great script! Appreciate the hard work you put in to keep this up.
I have expanded on it for my client’s environment to install SQL on the D: Drive and provide for the SQL Instance Directory location. Lastly, I built an option to install the SQL 2012 SP1 Express Management Studio Tools. Let me know if you would like to include some of the code in your version.
Hi thanks for script. However I got errors below when I ran it for Lync Standard?
“Select an option.. [1-99]?: 3
Installing operating system prerequisites
True
True
WARNING: You must restart this server to finish the installation process.
Installing RTCLocal instance. This will take several minutes.
True
Folder: “c:\_Install” does not exist, creating…Done!
File: SQLEXPR_x64_ENU.exe does not exist, downloading…Done!
Failed!
Installing LyncLocal instance. This will take several minutes.
File already exists
Failed!
Installing RTC instance. This will take several minutes.
Failed!
Installing SQL Management Studio. This will take several minutes.
True
Folder: “c:\_Install” exists.
File: SQLManagementStudio_x64_ENU.exe does not exist, downloading…Done!
Executing Install
Failed!
Installing Microsoft Silverlight
True
Folder: “c:\_Install” exists.
File: Silverlight_x64.exe does not exist, downloading…Done!
File: Silverlight_x64.exe…………………………………[installed!]
Finished”
If you reboot and try again, does it work? Looks like the OS prereqs required a reboot, which will cause the SQL instances to fail. The script should have stopped before trying the SQL instances and forced a reboot.
Let me know.
Just to add another log paste, my run warned me about requiring a reboot but carried on anyway. This was with the -Standard switch.
Select an option.. [1-99]?: 3
Installing operating system prerequisites
True
True
WARNING: You must restart this server to finish the installation process.
Installing RTCLocal instance. This will take several minutes.
True
Folder: “c:\_Install” does not exist, creating…Done!
File: SQLEXPR_x64_ENU.exe does not exist, downloading…Done!
Failed!
Installing LyncLocal instance. This will take several minutes.
File already exists
Failed!
Installing RTC instance. This will take several minutes.
Failed!
Installing SQL Management Studio. This will take several minutes.
True
Folder: “c:\_Install” exists.
File: SQLManagementStudio_x64_ENU.exe does not exist, downloading…Done!
Executing Install
Failed!
Installing Microsoft Silverlight
True
Folder: “c:\_Install” exists.
File: Silverlight_x64.exe does not exist, downloading…Done!
File: Silverlight_x64.exe…………………………………[installed!]
Finished
And depending on how complete you want the script to be, you may want to do a free space check on the disk. I ran out of space on the lab server I am running this on. I’d say checking for 20GB would be good as I had ~10GB available before I started.
Thanks. I think I’ve got that resolved in an upcoming release (probably Friday). I appreciate the comments!
Did the reboot and the script ran successfully thanks. Just one issue when I try to publish the TOP for standard server I get “creating central management store – Failure”
Thanks for updated script. The -standard switch no longer works? How are the standard options install selected?
Correct. As mentioned in the changelog, just select the FE option. Once the two SQL instances are installed, you’ll get prompted as to whether it’s a standard server. If it is, it will install the remaining required instance.
Ah just got to the prompt asking if it was standard server… very cool!