This script will assist in getting servers ready for the installation of Microsoft Lync Server 2013 on Windows Server 2012 and Windows Server 2012 R2. 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, Front End, Office Web Apps, Persistent Chat, and Mediation server prerequisites, and more tools. If you have suggestions, please feel free to comment below.
In the event that the server needs to be rebooted before prereqs can continue, it will automatically restart the script and continue after you reboot and login again.
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 SP2 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 SP2 version saves a long update later. Note that each instance takes 3-5 minutes to install – longer on slower machines. 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. This option will also prompt (if the firewall is enabled) if you’d like the required firewall exceptions created for my Get-CsConnections.ps1 script. This option will also prompt if the Lync Room System Admin Portal will be installed. If you select Yes, the ASP.NET MVC 4 for Visual Studio 2010 SP1 and Visual Web Developer 2010 SP1 prerequisite for that is installed.
4. Mediation – Installs the OS prerequisites required and the RTCLocal SQL instance.
5. Office Web App – Installs the OS prerequisites required, then installs the Office Web App binaries, and then prompts to install the English language pack, followed by the re-released SP1 update. Almost everything needed to deploy an Office Web Apps server. This option also verifies that Windows Update settings are NOT set to automatic, as that is not recommended.
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. Install/Update Lync Server 2013 Documentation Help
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. SCOM Watcher Node prerequisites
17. Custom PortQryUI. PortQryUI is installed, along with a custom config file that adds Lync related options.
18. Install Microsoft Message Analyzer (formerly NetMon)
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
23. Disable automatic updates. The automatic updating of Lync servers isn’t recommended due to the additional manual steps that must take place. And it’s not supported at all on Office Web Apps servers.
24. Microsoft Unified Communications Managed API 4.0, Runtime (UCMA 4.0) – this is required if you’re going to run sefautil.exe from the resource kit. It’s still recommended that sefautil.exe be used on a dedicated box.
25. Set recovery of Lync and/or OWAS services to “restart”. See Set recovery of Lync services to “restart” for more info.
28. Configure Skype Federation. This removes the MSN Public Provider and adds the Skype Public Provider, complete with icon. Download includes the Lync-Skype Provisioning Guide. See http://blogs.technet.com/b/lync/archive/2013/05/23/lync-skype-connectivity-available-today.aspx for more info.
29. Disable SSL 3.0. This is in response to the POODLE attack issue. Disabling SSL 3 will help reduce risk. The caveat is that disabling it will break connectivity for XP machines running IE 6/7.
30. Wireshark. This downloads the installer and starts it. Due to the fact that WinPCap can’t be silently installed, a silent install of Wireshark isn’t possible. You’ll just have to go through the install manually (normally just picking all of the default options).
31. Enable Photo URL option. Enables the photo URL option in the client. See http://www.lynclog.com/2013/11/lync-2013-client-and-and-pictures-from.html for more info.
32. Fix Control Panel font. Reverts the font in the Control Panel back to the original Segoe UI. See Resetting the Font in Lync Server Control Panel – Goodbye Times New Roman!
33. Set server power plan to “High Performance”. See http://www.ehloworld.com/2558
34. Lync Room System (LRS) Admin portal prerequisites.
36. Create Lync file share on local computer. This creates a file share on the local computer called “LyncShare”, and assigns the basic NTFS and share rights. This can then be added to the Lync Topology Builder.
40. Desktop shortcuts menu. This is basically an enhanced menu driven version of Create a Shutdown/Restart/Logoff Windows 8 Tile for the Start menu (PowerShell) that puts easy to reach tiles on the Start screen. The available tiles are:
4. Windows Update
5 Lync Server Management Shell
6. Lync Server Deployment Wizard
7 Lync Server Control Panel
8. Exchange UM Integration Utility (OcsUmUtil)
10. OCSLogger Logging Tool
11. Lync Server Topology Builder
12. Certificate Management (local machine)
13. Active Directory Users and Computers (ADUC)
14. Microsoft Message Analyzer
60. Taskbar shortcuts menu. These options create shortcuts on the taskbar for commonly used tools.
1. Lync Server Management Shell
2. Lync Server Deployment Wizard
3. Lync Server Control panel
4. Exchange UM Integration Utility (OcsUmUtil)
6. OCSLogger Logging Tool
7. Lync Server Topology Builder
8. REMOVE shortcut for PowerShell
9. Certificate Management (local machine)
10. Active Directory Users and Computers (ADUC)
11. Microsoft Message Analyzer
12. REMOVE Windows App Store shortcut (Windows Server 2012 R2)
80. Downloads only menu. This menu shows options for download (only) of some key Lync related products.
1. Download latest Lync Server 2013 Cumulative Update
2. Lync Server 2013 Watcher Node
3. Lync Server 2013 Management Pack & Documentation
4. Lync 2013 Rollout and Adoption Success Kit (RASK)
5. Lync Server SDN API 2.1 (includes the API installer, the management utility, the docs, and the .chm file)
90. Security menu. This menu has a few related security options
- Disable SSL 2.0
- Disable SSL 3.0
- EnableSessionTicket: Event IDs 32402, 61045 are logged in Lync Server 2013 Front End servers that are installed on WIndows Server 2012 R2 (KB 2901554)
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 the CD-ROM/DVD-ROM drive with the lowest drive letter (typically D: or E:), 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 a logs folder inside the $TargetFolder (by default, c:\_install). This log file should be included when reporting any bugs.
C:\Set-Cs2013Features.ps1 [-TargetFolder ] [-Win2012Source ]
[-SQLPath ] [-InitialMenuOption ] [-IncludeSSMS] [-IncludeTelnet] [-IncludeFW] [-IncludeHighPower]
[-IncludeStandard] [-DownloadOnly] [-WhatIf] [-Confirm] [-IncludeTotalCount] 
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
Defines the location for any downloaded files. Defaults to “c:\_install”. Additionally, log files generated by this script are located in a subfolder of TargetFolder called “logs”. TargetFolder does not support paths with spaces.
Defines the location of the Windows Server 2012 installation files. This is needed to install .Net 3.5 since those files are not installed on the server by default. Defaults to first detected CD-ROM/DVD drive.
Defines the desired installation path for SQL Express. Defaults to “c:\Program Files\Microsoft SQL Server”
Allows you to start the script with the option you want, without first displaying the menu.
If specified, will include SQL Server Management Studio automatically when prereqs for Front End servers are installed. If not specified, a prompt will appear.
If specified, will include Telnet automatically when prereqs for Front End servers, Director servers, Mediation servers, Edge servers, and/or Persistent Chat servers are installed. If not specified, a prompt will appear.
If specified, will include the firewall rules for Get-CsConnections automatically when prereqs for Front End servers are installed. If not specified, a prompt will appear.
If specified, tells the script to automatically set the Power Config on the server to High Power. This is instead of the script prompting.
If specified, tells the script to include the extra SQL Express instance required for Standard Edition front end servers. This is instead of the script prompting.
This value is only used during mid-prereq reboots. It is automatically set and read by the script, and should not be manually specified.
Tells this script to not install or configure anything – just download the files for the option you select. This is useful if you’re going to be building servers that do not have Internet access and want to fetch the files beforehand.
Tells this script to not install or configure anything – just download ALL of the files. This is useful if you’re going to be building servers that do not have Internet access and want to fetch the files beforehand. Note that a complete set of files is currently around 3.8GB.
An issue has been identified in Windows Server 2012 servers that are built as Server Core, but converted later to Server with GUI. Installation of Windows Features, either manually or via a script, fail if Windows Updates are installed BEFOREHAND. That being the case, this script cannot be used in such scenarios. I’m working on detecting (if possible) servers that are converted, as well as researching why they fail. Thanks to John for pointing it out. It’s likely that the issue detailed here is the cause.
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.
Frequently Asked Questions
Question: Why doesn’t this script support Windows Server 2008 R2?
Answer: I get asked this all the time. There are several reasons. The first is that out of the box, Server 2008 R2 has PowerShell 2.0 installed, and this script is written in PowerShell 3.0. Requiring you to upgrade to PowerShell 3.0 first, before running a script that installs prerequisites, seems counter-intuitive. And converting the script to just use PowerShell 2.0 is taking a step backwards, especially considering that the current version of PowerShell is 4.0, and even as this is written, 5.0 is in preview.
Next is sheer time. I test changes I make. And then I test them again. And then I choose different options and combinations and test them. Testing on just Server 2012 and Server 2012 is exhausting. Adding Server 2008 R2 would mean even more testing, plus I’d have to add those resources in my already overtaxed test labs. That would slow down my ability to add new features and test fixes.
Third is that Server 2008 R2 is two versions back. Get with the times already!
Question: Can you add feature x?
Answer: I LOVE getting feature requests. Seriously! Best method to suggest features is to send me an email. My email address is in the comment section at the top of every script I release. Please be detailed in what you’d like to see, as well as any scenarios you’d use the option (so I can try to duplicate testing).
Question: How do I submit bug reports?
Answer: Email is best. Grab my email address from the comment section at the top of the script. Please be VERY detailed. Please include screen shots if possible, and ALWAYS include the log file (by default, it’s in c:\_install\logs). If you’re not using the latest version of the script, please download it and see if you can duplicate the problem before reporting it.
Question: What if my server doesn’t have Internet access?
Answer: Fear not. Download the required files using either the -DownloadOnly or -DownloadAll options from another machine and place them in the TargetFolder, which is c:\_install by default. The script looks to see if the file is available locally before attempting to download.
v3.2 – 12-22-2014 – Set-Cs2013Features.v3.2.zip
v3.1 – 10-24-2014 – Set-Cs2013Features.v3.1.zip
v3.0 – 10-06-2014 – Set-Cs2013Features.v3.0.zip
v2.9 – 09-22-2014 – Set-Cs2013Features.v2.9.zip
v2.8 – 08-13-2014 – Set-Cs2013Features.v2.8.zip
v2.7 – 06-26-2014 – Set-Cs2013Features.v2.7.zip
v2.6 – 06-10-2014 – Set-Cs2013Features.v2.6.zip
v2.5 – 05-24-2014 – Set-Cs2013Features.v2.5.zip
v2.4 – 04-29-2014 – Set-Cs2013Features.v2.4.zip
v2.3 – 02-08-2014 – Set-Cs2013Features.v2.3.zip
v2.2 – 01-20-2014 – Set-Cs2013Features.v2.2.zip
v2.1 – 12-17-2013 – Set-Cs2013Features.v2.1.zip
v2.0 – 11-26-2013 – Set-Cs2013Features.v2.0.zip
v1.9 – 10-28-2013 – Set-Cs2013Features.v1.9.zip
v1.8 – 08-01-2013 – Set-Cs2013Features.v1.8.zip
v1.7 – 05-31-2013 – Set-Cs2013Features.v1.7.zip
v1.6 – 05-24-2013 – Set-Cs2013Features.v1.6.z1p
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
See the changelog for information on what’s changed/included in each version.