Script: Set-Cs2013Features.ps1 – Easily Install Prerequisites and Tools for Microsoft Lync Server 2013
Note: This script is now deprecated. Please see the newer Script: Set-CsFeatures.ps1 – Easily Install Prerequisites and Tools for Lync Server 2013 and Skype for Business Server 2015 script for the latest version.
Description
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. It also verifies the server is not domain joined, then goes through the process of setting the primary DNS suffix (same as option 50-13). Also configures NICs to remove DNS and gateway from the internal NIC, remove dynamic registration in external NIC, and prompt to disable both lmhosts and NetBIOS over TCP/IP.
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. Choosing the Front End option will ask if it’s a Standard Edition server. 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 most recent cumulative 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
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. ARR (“Pirate Proxy”) prerequisites. This installs the Windows features, and downloads the Web installer. It also verifies the server is not domain joined, then goes through the process of setting the primary DNS suffix (same as option 50-13). Also configures NICs to remove DNS and gateway from the internal NIC, remove dynamic registration in external NIC, and prompt to disable both lmhosts and NetBIOS over TCP/IP.
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.
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.
30. Wireshark. This downloads the installer, and two compiled macro exe files and runs them. The first installs WireShark, and the second configures WireShark for optimized Lync tracing, including the steps recommended by Matt Landis (Getting Started With Lync and Wireshark: Tips & Quirks) and Jeff Schertz (Wireshark Capture Tips). That config includes:
- adds Source Port (resolved) column
- adds Destination Port (resolved) column
- adds DSCP column
- Configures RTP protocol “Try to decode RTP outside of conversations”
- Configures SIP protocol for ports 5060-5068 (instead of WireShark’s default of 5060)
- Sets the time format to human readable format
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.
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.
50. Misc server config menu.
- Install/Update Lync Server 2013 Documentation Help
- Create scheduled task to automatically update PowerShell help files daily. I discuss this in Function: New-PSUpdateHelpScheduledTask – Auto Update PowerShell Help
- Install telnet client
- 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.
- Set recovery of Lync and/or OWAS services to “restart”. See Set recovery of Lync services to “restart” for more info.
- Set fabric logging to circular. See Tom’s excellent article at Check your lync server windows fabric log size with PowerShell
- Disable Server Manager on logon. For those of you who hate that it always pops up when logging in.
- Upgrade to PowerShell v4.0. This is for Windows Server 2012 RTM (not R2) boxes that still have the default PowerShell v3.0 on them. Upgrading PowerShell both before and after Lync Server is installed is supported.
- 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!
- Set server power plan to “High Performance”. See https://www.ucunleashed.com/2558
- Open HOSTS file in notepad for editing. This is convenient on edge servers.
- Configure edge static routing – adds the static routes for all private address ranges to use the internal NIC. The user is prompted with a list of NICs discovered, and asked to pick which will be used for the internal connection. Once picked, the script will determine if there is already a gateway defined. If so, it will use that IP address to create the static routes. If there is no default gateway assigned, the user is prompted to enter the gateway that the static routes should use. The DNS server config is removed from the internal NIC. The gateway on the internal NIC is removed. A prompt will appear, and if accepted, lmhosts lookup is disabled on all NICs. Another prompt will appear, and if accepted, NetBIOS over TCP/IP is disabled.
- Configure primary DNS suffix. This prompts for a domain name, assigns it as the primary DNS suffix, then reboots. This configuration is required for edge and ARR (reverse proxy) servers.
60. 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:
- Logoff
- Restart
- Shutdown
- Windows Update
- Lync Server Management Shell
- Lync Server Deployment Wizard
- Lync Server Control Panel
- Exchange UM Integration Utility (OcsUmUtil)
- Snooper
- OCSLogger Logging Tool
- Lync Server Topology Builder
- Certificate Management (local machine)
- Active Directory Users and Computers (ADUC)
- Microsoft Message Analyzer
- Notepad Desktop Shortcut for Edge servers to open the HOSTS file
70. Taskbar shortcuts menu. These options create shortcuts on the taskbar for commonly used tools.
- Lync Server Management Shell
- Lync Server Deployment Wizard
- Lync Server Control panel
- Exchange UM Integration Utility (OcsUmUtil)
- Snooper
- OCSLogger Logging Tool
- Lync Server Topology Builder
- REMOVE shortcut for PowerShell
- Certificate Management (local machine)
- Active Directory Users and Computers (ADUC)
- Microsoft Message Analyzer
- 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
- Lync Server 2013 Watcher Node
- Lync Server 2013 Management Pack & Documentation
- Lync 2013 Rollout and Adoption Success Kit (RASK)
- Lync Server SDN API 2.1 (includes the API installer, the management utility, the docs, and the .chm file)
- Lync Online Admin components
- Event Zero connector
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.
Syntax
C:\Set-Cs2013Features.ps1 [-TargetFolder ] [-Win2012Source ] [-SQLPath ] [-InitialMenuOption ] [-IncludeSSMS] [-IncludeTelnet] [-IncludeFW] [-IncludeHighPower] [-IncludeStandard] [-DownloadOnly] [-Tail] [-WhatIf] [-Confirm] [-IncludeTotalCount] [-ClearRunningStatus] []
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
Parameters
-TargetFolder
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. UNC paths are acceptable provided they are not hidden, such as \\server\share$.
-Win2012Source <String>
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. UNC paths are acceptable provided they are not hidden, such as \\server\share$. Unmounted .ISO images are also supported.
-SQLPath
Defines the desired installation path for SQL Express. Defaults to “c:\Program Files\Microsoft SQL Server”
-InitialMenuOption
Allows you to start the script with the option you want, without first displaying the menu.
-IncludeSSMS []
If specified, will include SQL Server Management Studio automatically when prereqs for Front End servers are installed. If not specified, a prompt will appear.
-IncludeTelnet []
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.
-IncludeFW []
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.
-IncludeHighPower []
If specified, tells the script to automatically set the Power Config on the server to High Power. This is instead of the script prompting.
-IncludeStandard []
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.
-GetInfoFromRegistry []
This value is only used during mid-prereq reboots. It is automatically set and read by the script, and should not be manually specified.
-DownloadOnly []
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.
-DownloadAll []
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.
-Tail
Shows a tail of the log file as it’s written. It automatically restarts if the script reboots the server, too. Really only beneficial for troubleshooting.
-ClearRunningStatus
Resets the warning flag if the script didn’t close gracefully and you get the “The script is already running” error.
Installation
WARNING!
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.
Donations
I’ve never been one to really solicit donations for my work. My offerings are created because *I* need to solve a problem, and once I do, it makes sense to offer the results of my work to the public. I mean, let’s face it: I can’t be the only one with that particular issue, right? Quite often, to my surprise, I’m asked why I don’t have a “donate” button so people can donate a few bucks. I’ve never really put much thought into it. But those inquiries are coming more often now, so I’m yielding to them. If you’d like to donate, you can send a few bucks via PayPal at https://www.paypal.me/PatRichard. Money collected from that will go to the costs of my website (hosting and domain names), as well as to my home lab.
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.
Question: When I run the script again, I get “Script already running”
Answer: This is because the script didn’t exit gracefully. Many reasons this can happen, such as rebooting the server while it’s still running. If you’re positive it’s not running anywhere else (including by other users logged into the same server), run the script with the -ClearRunningStatus switch to clear that flag. Then run it as normal.
Download
v3.8 – 03-25-2015 – Set-Cs2013Features.v3.8.zip
v3.7 – 02-27-2015 – Set-Cs2013Features.v3.7.zip
v3.6 – 02-12-2015 – Set-Cs2013Features.v3.6.zip
v3.5 – 02-02-2015 – Set-Cs2013Features.v3.5.zip
v3.4 – 01-26-2015 – Set-Cs2013Features.v3.4.zip
v3.3 – 01-07-2015 – Set-Cs2013Features.v3.3.zip
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
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!
ehloworld.com blog from Pat is a treasure chest and this particular script is the crown jewel made by a true Jedi master. Thank You !
Pat –
VERY nice work.
John
Hi Pat, really great script! I also installed Office Webapps with it but I’m wondering which key it uses. Is there a way to change the product key afterwards?
It does not enter any key. Nor is one needed, I believe.
Could you add a option for installing IIS ARR?
http://blogs.technet.com/b/nexthop/archive/2013/02/19/using-iis-arr-as-a-reverse-proxy-for-lync-server-2013.aspx
Also this patch for iOS: http://www.microsoft.com/en-us/download/details.aspx?id=30333
Not sure I’m going to be able to get to that anytime soon. I don’t have a lab environment to test that.
#19 Has a spelling error: The term ‘Set-ModuleStatue’ is not recognized as the name of a cmdlet
Thanks Corey. I’ve updated my copy and will get a new version out soon.
Testing the latest 1.7, the sql express path cannot contain any spaces. Fails the validation line 35.
Looks like I have this resolved in v1.8, which should be out in the next day or so.
Hi Pat,
I get this error when installing OWAS. Suppose it just means it does not detect a proxy?
“Get-ItemProperty : Property ProxyEnable does not exist at path HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVers
ion\Internet Settings.
At C:\temp\Set-Cs2013Features.ps1:1028 char:7
+ if ((Get-ItemProperty “HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet …
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (ProxyEnable:String) [Get-ItemProperty], PSArgumentException
+ FullyQualifiedErrorId : System.Management.Automation.PSArgumentException,Microsoft.PowerShell.Commands.GetItemPr
opertyCommand”
Yeah, that’s something I’m seeing as well on new machines that have never had a proxy. Go to line 1028, which looks like this:
if ((Get-ItemProperty “HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings” -name ProxyEnable).ProxyEnable){
and replace it with this:
if ((Get-ItemProperty “HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings” -name ProxyEnable -ea 0).ProxyEnable){
and tell me if it goes away.
Awesome work Pat. How hard would it be to tell the script that it can run on Windows 2012 R2? Playing in lab and would love to fire script up but running R2 VM’s. Would it be as simple as editing here?
#region variables
[bool]$IsSrv2012 = (Get-WMIObject -class Win32_OperatingSystem).Version -match “6.2.920”
[bool]$IsSrv2008R2 = (Get-WMIObject -class Win32_OperatingSystem).Version -match “6.1.760”
I actually have a version that does run in 2012 R2. I was waiting for some more info from the product group as to any changes I would need to make from a prereq standpoint.
Thanks Pat – have changed the entry for the version match to use 6.3.9600 and the script seems to work well. Have used the pre-requisite install for FrontEnd and just having a look at other options. Will keep an eye out for your next release. Thanks again for your amazing work.
I would drop that last zero to include service packs versions.
True! Thanks again. Will let you know if I encounter any 2012 R2 oddities during my testing.
This script is wonderful. I have been struggling to get the prerequisites installed and this does al lthe work. Thank you
Hi, I used the script on a new Lync 2013 deployment on the first enterprise frontend server with the command “Set-Cs2013Features.ps1 -Win2012Source e:” and even though it mentions installing SQL on step 3 I don’t actually see SQL express installed.
What am I doing wrong? I didn’t specify the sql parameter because the sql express installation should natively install db’s on a separate drive if it exists. If run through the deployment wizard to install local store at least.
It doesn’t necessarily install them on a separate drive. Did you check the registry to see if they are listed there? The script looks at HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server\Instance Names\SQL for a key with the name of the instance (RTCLocal, LyncLocal, and, if it’s a standard edition, RTC). If the deployment wizard installs the instances, it uses the 2012 RTM version of SQL Express, whereas the script uses the SP1 version. So it saves you an upgrade.
Is attempting to get this working on Windows 2008 R2 going to be worth a go? Or are you using a large number of 2012 specific features?
It’s not going to happen. The script is written in PowerShell v3.0, which is native to Windows Server 2012 and above. Additionally, I don’t have the time to test in a 2008 R2 environment. 2008 R2 is already two versions back.
I beg your pardon – I wasn’t suggesting *you* do it – I was going to have a crack. But I’ve not had a chance to really digest the content yet, so was going to ask for a feel from you on how hard that would be.
All our Lync boxes here have PowerShell 3.0 installed already – so that hurdle at least is crossed.
I don’t see it being worth it. I’ve had very little requests for it, as nearly everyone I talk to is installing on 2012 or 2012 R2. Converting it to support 2008 R2 could be painful, and since I’m constantly updating the script (a new version is due out soon), it would be out of date.
Lucky them – I’m going to be stuck on 2008 R2 for the forseeable future. Oh well – thanks for your advice.
Hi Pat,
Just a followup – if the host server for the Lync install EVER started as a core install, then moved to GUI (and this includes template server installs), your script is going to blow up on doing the Lync prereqs. The only way around this is to fix the host install (or get a clean full install to start with) – but your script will probably get blamed from the onset – when it is a host server issue with the inkandhandwritingservice and how the sxs local and on source get out of sync and refuse to play well with add-windowsfeature. Maybe you could add some logic checking to detect this condition?
-John
Thanks, John. Per our Lync conversation, I’m researching to see if there is a way I can detect this scenario, and throw a flag.
Options 13(help) and 16(desktop tiles) in the script menu is opposite of blog description.
Thanks. I’ve updated the article.
HI,
I discovered a Bug on the Web App case. the script is not taking the -Win2012Source option.
to test I edited the ps file . after Case 5 (Switch 5) added the -Source …….
correct line below.
thank you for your script, great work!
$RestartNeeded = (Add-WindowsFeature Web-Mgmt-Console, Web-Common-Http, Web-Default-Doc, Web-Static-Content, Web-Filtering, Web-Windows-Auth, Web-Net-Ext45, NET-WCF-HTTP-Activation45, Web-Asp-Net45, Web-ISAPI-Filter, Web-Includes, Web-Stat-Compression, Web-Dyn-Compression, InkAndHandwritingServices, NET-Framework-Core, NET-HTTP-Activation, NET-Non-HTTP-Activ, Web-ISAPI-Ext, NET-Framework-45-Core, NET-Framework-45-ASPNET -Source $Win2012Source\sources\sxs).RestartNeeded
Yeah, that’s actually already fixed in v2.2, which should be out as soon as I add one more feature.
Your absolutely right, you do not require a key for Office Web Apps.
awesome script!
how about adding “create the file share store” ?
with the New-SmbShare command it’s easier then ever to script 🙂
I have been looking at that for a while. I suppose it’s time I took the plunge and implemented it.
great ! btw, I believe you should remove the -NoConsole and -Indent 1 on all of the write-error as powershell 3+ does not have these anymore…
I don’t believe there are any Write-Error commands. Anything that uses -NoConsole and -Indent is for my Write-Log function.
sorry, it appears just once.. line 1664 🙂
Yeah, that was already resolved in v2.7. Thanks.
In v2.7, Option 20 doesn’t seem to work….appears like a variable is misspelled
$initanswer instead of $intanswer
You are correct. It will be fixed in v2.8. Thanks for reporting it!
Pat – awesome script. I’ve used it sucessfully to get all the pre-reqs installed. Now I want to automate the rest of the installation. Any clues how to automate the rest? Right now, I can’t get past the initial loading of files that setup.exe and setup2.exe do. Clues would be most useful!
It can certainly be done, but it’s a little more involved. I’ve had it working in my lab but not yet to the point I can put it in the script.
Hi Thomas, try these guys “www.lynclab.org” they have a script that builds the whole server from scratch, you can pick out parts of it that will do most of what you are looking for. I have been through this before, and it took me months to figure it out before stumbling upon these guys.
Keep in mind that those scripts are for deploying a LAB, with VERY specific configuration and parameters. Not a production deployment. Lots of ancillary work to do in a production network. While those scripts are very good, make sure you don’t think of it as an end-all solution. Some consultants have created solutions that work. Some can read from spreadsheets, XML, CSV, etc. to determine configuration. These are highly detailed, complex solutions that take a lot of effort out of the implementation. Since a lot (if not most) of these would be work product, it might be difficult to find one publicly available.
I recommend that you look around and piece together something that fits your requirements.
How can i reverse Number 31 “Enable Photo Url Option”?? i wanted to try it and it works but i would like to restrict it/ so how do i remove it from my global policy now that i neabled it??
In theory, this might work. But untested.
$PolicyEntry = New-CsClientPolicyEntry -Name EnablePresencePhotoOptions -Value True
$PolicyObject = Get-CsClientPolicy -Identity Global
$PolicyObject.PolicyEntry.Remove($PolicyEntry)
Set-CsClientPolicy -Instance $PolicyObject
Pat – thanks for this. Unfortunately, my employer wants me to use Windows Server 2008 R2. My question is about the Domain Controller. I tried Matt’s instructions and unless I install a DC on the front end, I get an error in the Prepare Schema. Do I start with a DC and then demote it?
Thanks,
Frank
Why would you install a DC on a Lync server? That’s not needed. If you read the documentation on the schema updates, you’ll see the requirements needed.
Hi.
Is it possible to adjust the path of where OWAS Server is installed to ?
If you install it to anyplace other than the system drive, you’ll have inconsistent results.
What do you mean by “inconsistent result” ?
By using manual install, the OWAS install, allows you to install to any drive.
From my experience, and a fair number of online resources, installing to another drive causes it to be really flaky, or not work at all. Usually you get rendering issues.
Pat, I do not see v3.0 on this page? Is there a new location, where we can download this script?
Thank you,
SP
My bad. Check the page now.
Legend! Thanks again for all your awesome work Pat!
Thank you. I also noticed, that, you have removed Download updates option. Are you considering to bring it back ?
Thanks as always for detailed work.
sp
Thank you for the beautiful work 🙂 – saves tons of time
I’m having some trouble with the 3.1 version. I’m sure i’m doing something wrong – but, I am getting C:\Windows\WinSxS\sources\sxs does not exist. │ Run the script again, specifying -Win2012Source
So, I don’t have the path – but, when I was using v2.7 I didn’t have to do this – and the servers seem to be setup the same way. I DO, have a c:\windows\WinSxS folder, but not the rest of the path. Any tips? In the meantime, I’m going to downgrade until I can find a version that will work with my setup.
THANKS FOR YOUR AWESOME SCRIPT. _G
-Win2012Source isn’t looking for the installation folder that Windows is installed in. It’s looking for where the installation media files (read: DVD) files are. It needs to grab files from the installation media to install .Net 3.5.
Cool. I am in the process of copying DVD\resources\sxs over to the server and I’m sure it’ll work just fine. Thanks Pat.
Just mount the DVD and point -Win2012Source to the root of the drive.
Great Script! I mentioned it to some of the PowerShell guys at TechEd and they suggested I contact you. There’s 1 small thing that I feel could improve the script even more. You seem to use BITS for download. Somehow, this doesn’t perform very well (actually it slow as ….) in my environment. The PowerShell guy suggested using an http download method instead. He showed me (I forgot the commandlet) and it was lightning fast. Maybe an idea for your script?
http://blogs.technet.com/b/office_sustained_engineering/archive/2014/10/22/web-apps-server-removal-from-download-center.aspx
This means that menu choice 5 (Install Office Web Apps server) cannot download img file.
True. But if you download the .img ahead of time from the volume licensing site, and put it into c:\_install, the script will run as intended.
I think I found a small bug. When running the script, PowerShell mentions the option to use “Unblock-File”, so I did. Now, every time I start the script, it say “Already Running”. Even tried a reboot, but no use. How can I get it to run again?
If it still says it’s already running, it’s because the script exited dirty due to a problem. Run the script again with just the -ClearRunningStatus option, and that will reset that.
Cool, worked like a charm 🙂 Thanks!
Thanks for all your efforts. Question: on the front-end section, it says “See the syntax and example sections below on how to call the script for the two types of servers.” however this is never explained below as far as I can tell. I’m trying to use the script to setup a single Standard Edition server. Thank you!
Ah – sorry about that – that’s old text. Choose option 3 for Front End. You’ll eventually be asked (during the SQL Express installs) if it’s a Standard Edition. Answer Yes.
I selected option 3, to install the front-end and it doesn’t appear that the script installed MS Silverlight or any SQL Express instances (I don’t see anything in the folder I specified for SQL Express, and nothing that looks like it in add/remove programs, lastly Lync Installation does not seem to ‘find’ any instances and wants to create a database instance). I was using script v3.3 on a new install of Windows 2012 R2.
2015-01-14 10:45:07 : INFO : Option 3 (Front End server)
2015-01-14 10:45:07 : INFO : Checking for Win2012Source
2015-01-14 10:45:07 : INFO : Win2012Source is valid
2015-01-14 10:45:07 : INFO : Installing operating system prerequisites
2015-01-14 10:50:51 : INFO : Restart is required
2015-01-14 10:53:35 : INFO : User chose NOT to reboot
2015-01-14 10:53:35 : INFO : ——————————
2015-01-14 10:53:35 : INFO : Total elapsed time (hh:mm:ss): 00:09:37
2015-01-14 10:53:35 : INFO : Exiting script
2015-01-14 10:53:35 : INFO : v3.3 script end
My goal is to have a Lync Standard Server with persistent chat, should I also be selecting the Persistent Chat option in the script, option 6?
That’s because it’s not done. The script needs to reboot and continue it’s work.
This seems to be a major sticking point if the user selects ‘no’ on the reboot as there is no way to resume the processes or do the ‘reboot’ that the script wanted to do in order to complete (rebooting manually has no affect).
At this point I think my options would be:
1) Wipe the server and start over
OR
2) Install everything from the Lync media since I’m locked out of running option 3 of the script at this point.
I would recommend requiring the reboot or having it give a stern warning as selecting ‘No’ on the reboot puts one in a purgatory state.
Thanks for your efforts on the Script, any advice is greatly appreciated, and hopefully leads to further refinements benefiting other users.
Which reboot? You can run the script as many times as you want to complete the tasks.
Everytime I run the script it says “Script Already Running”. So I’m locked out of running it again. I’ve tried rebooting etc. This happened after I selected option 3, and subsequently picked ‘no’ when it asked to reboot (I like to reboot myself). The author said that the Option 3 did not finish (did not install SQL instances or silverlight) because I selected ‘no’ on the reboot prompt he also said that’s why its stuck in this loop because it needs to reboot to finish its processes, perhaps it would have resumed processes if I had picked ‘yes’ on the reboot option. This is all my best interpretation of the authors answers above. I just read in an old post there is a “-ClearRunningStatus” switch. I will give that try so that I can run the script again.
Another item to report, I’m getting “script already running”. I tried rebooting and then renaming the _install folder so that the script wouldn’t find the _install folder and it still gets this error:
2015-01-26 01:28:12 : INFO : v3.4 script start
2015-01-26 01:28:12 : INFO : Checking if script is already running
2015-01-26 01:28:12 : ERROR : Script is already running
2015-01-26 01:28:12 : INFO : v3.4 script end
2015-01-26 01:28:12 : INFO : Total elapsed time (hh:mm:ss): 00:00:00
Here is the end of the last log file prior to the ‘script already running’ issue occurring:
2015-01-25 22:36:47 : INFO : Option 20 (SQL Server Management Studio)
2015-01-25 22:36:47 : INFO : Installing SQL Management Studio
2015-01-25 22:36:47 : INFO : This will take several minutes
2015-01-25 22:36:48 : INFO : Checking if a proxy is enabled
2015-01-25 22:36:48 : INFO : Proxy is not enabled
2015-01-25 22:36:52 : INFO : Target folder “C:\_Install” exists – no need to create
2015-01-25 22:36:52 : INFO : Internet access available
2015-01-25 22:36:52 : INFO : File “SQLManagementStudio_x64_ENU.exe” does not exist in “C:\_Install”
2015-01-25 22:36:52 : INFO : Downloading “http://download.microsoft.com/download/5/2/9/529FEF7B-2EFB-439E-A2D1-A1533227CD69/SQLManagementStudio_x64_ENU.exe” to “C:\_Install”
2015-01-25 22:43:40 : INFO : Successfully downloaded C:\_Install\SQLManagementStudio_x64_ENU.exe version 11.0.3000.0
2015-01-25 22:43:40 : INFO : Executing Install
2015-01-25 22:43:43 : INFO : Waiting for installation to finish
2015-01-25 22:59:07 : INFO : Done!
2015-01-25 22:59:09 : INFO : ——————————
2015-01-25 22:59:09 : INFO : Displaying main menu
The script wasn’t closed gracefully if that’s the end of the log. See the FAQ section on this page for info on clearing that flag if you’re CERTAIN it’s not running anywhere.
Every time the script closes I get an error about the powershelltailid;
Get-Process : Cannot bind argument to parameter ‘Id’ because it is null.
At D:\Data\Scripts\Set-Cs2013Features.ps1:2890 char:19
+ Get-Process -id $PowerShellTailId | Stop-Process
+ ~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidData: (:) [Get-Process], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.GetProcessCommand
When the script is running, are you opening other PowerShell windows?
Nope. Only running powershell window is the elevated one that I started the script from.
Another note. It would also be nice if you could specify $false or $true for the switches so that you can run the script without popups. If you do -IncludeSSMS $false it will fail saying it cannot find a positional parameter that accepts $false.
As a sidenote, it would also be nice if you could specify a submenu option from the script for -InitialMenuOption. Now you can’t because submenu options under like option 50 are numbered 1 to … again.
The fact that submenu options are numbered starting at 1 has nothing to do with -InitialMenuOption. That feature was implemented really around the more complex prereq options that take time. It’s mentioned in the main article that that option only applies to options in the main menu. No plan to change that.
As for specifying $false for some switches, I’ll see what I can do.
Thanks. Being able to set $true/$false would let you suppress any popups. As for the InitialMenuOption I understand. It’s just that it would be nice to be able to let you choose suboptions unattendedly through a main script 🙂
v3.7 – if you exit from the main menu by CTRL-C or by just closing PowerShell window, instead of using item “99) Exit”, then key “running” stays in the registry and prevent subsequent script execution until you manually delete the key from the registry.
PS: Thanks for great script!
You don’t have to manually remove the registry entry. This page shows you the command to run to clear that. You shouldn’t use CTRL+C to close it nor should you close the PowerShell window.
Hi Pat,
thanks for the great script – very useful.
Just a quick note, I noticed the v 3.7 doesn’t download the latest wireshark version, and it seems like the automatic configuration piece is failing because wireshark prompts for the update when it is in the middle of configuration.
Download version 3.9 of the script.
Can you included pre-requisites for setting up a monitoring/archiving server?
Those are roles filled by the front end server.
Thanks Pat for the greatly useful tool. Seems that the latest silveright versions (5.x) causes some issues in Virtual environments. Got personnaly the issue on HyperV (Control Panel returning script errors and failing basic operations such as enabling users) and in the latest Lync release notes the issue is reported in VMware environments. Can’t say how frequently this issue happens but this may justify a fallback to a 4.x version of Silverlight. Let me know if you need more details on the encountered issue.
Yep – known issue. Seems to hit those who use the shortcut to get to the control panel, but not those who go to the admin SimpleURL via a browser.
Pat, you are “The Boss”, almost 2 years after you created the script and still working.
Thanks a lot for your help.
Thanks for the kind words. The next version will also support prereqs for Skype for Business Server 2015. Look for it soon.
Pat
Any update on when your next version will be released? I’m already deploying SfB
Cheers
Jason
It’s in testing now.
Hi Pat,
any news about releasing date of 3.9 with Skype for Business Support ?
Working feverishly on it. So many other things also were released, such as debugging tools, SCOM management pack, new version of Wireshark, etc. Trying to roll everything in.
Hi.
Do you think a S4B version of this script is far away?
Any news Pat ? Have to deploy a big S4B infrastructure and need your awesome script !!! Can’t wait more !!! 😀 😀 😀
Hi Pat,
any news on the release date ?
Can we expect to get it soon ?
Thanks for your awesome work !
Pat
Have you ever thought about creating/modifying this to do an audit on servers once they are setup?
Are you still working on this? It’s been a year with no update….
Yes, it’s in beta. In fact, a new build went out this morning.
Hello,
Trying to download from Corporate :
URL : https://ucunleashed.com/downloads/1697/WireShark_2.2.1-install.zip
Type de support : application/executable
Nom du virus : McAfeeGW: BehavesLike.Win32.Downloader.ch
I’ve scanned the file on my end and it reports clean.
Hi Pat,
My colleagues and I have used set-cs2013features for a few years now and we are missing having an SfB version. Several of us have home labs and I was wondering if we could beta test the SfB version? We think it’s a great tool that saves us a lot of time and helps our consistency.
Thanks,
John Miller, Enabling Technologies
The beta testing period has closed. The script will be released soon. I just need to finish writing the blog post.
I’m sure it will. 🙂