Home > Lync Server > Script: Set-Cs2013Features.ps1 – Easily Install Prerequisites and Tools for Microsoft Lync Server 2013

Script: Set-Cs2013Features.ps1 – Easily Install Prerequisites and Tools for Microsoft Lync Server 2013

Lync 2013 logo 128x128Description

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 – 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 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. Create Windows Update tile on desktop

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. Creates a file share on the local computer. That information then should get added to Topology Builder.

38. 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:

41. Logoff
42. Restart
43. Shutdown
44. Windows Update
45 Lync Server Management Shell
46. Lync Server Deployment Wizard
47 Lync Server Control Panel
48. Exchange UM Integration Utility (OcsUmUtil)
49. Snooper
50. OCSLogger Logging Tool
51. Lync Server Topology Builder
52. Certificate Management (local machine)
53. Active Directory Users and Computers (ADUC)
54. Microsoft Message Analyzer

60. Taskbar shortcuts menu. These options create shortcuts on the taskbar for commonly used tools.

 61. Lync Server Management Shell
62. Lync Server Deployment Wizard
63. Lync Server Control panel
64. Exchange UM Integration Utility (OcsUmUtil)
65. Snooper
66. OCSLogger Logging Tool
67. Lync Server Topology Builder
68. REMOVE shortcut for PowerShell
69. Certificate Management (local machine)
70. Active Directory Users and Computers (ADUC)
71. Microsoft Message Analyzer
72. 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.

81. Download latest Lync Server 2013 Cumulative Update
82. Lync Server 2013 Watcher Node
83. Lync Server 2013 Management Pack & Documentation
84. Lync 2013 Rollout and Adoption Success Kit (RASK)
85. Lync Server SDN API 2.1 (includes the API installer, the management utility, the docs, and the .chm file)

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]] [-WhatIf] [-Confirm]



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



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. 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 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.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.

  1. Ronald
    February 11, 2013 at 4:02 pm | #1

    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.

    • Pat Richard
      February 11, 2013 at 4:25 pm | #2

      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.

      • Ronald
        February 11, 2013 at 4:41 pm | #3

        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.

  2. Pat Richard
    February 11, 2013 at 4:43 pm | #4

    Sure – send them along. My email address is in the comment block of the script.

  3. Christophe
    February 12, 2013 at 9:41 am | #5

    very nice script, thanks for the share

  4. February 14, 2013 at 11:02 pm | #6

    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.

    • Pat Richard
      February 14, 2013 at 11:06 pm | #7

      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.

  5. Andy Thompson
    March 13, 2013 at 11:33 am | #8

    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?

    • Pat Richard
      March 13, 2013 at 9:09 pm | #9

      Debugging tools already checks for that. I’m adding the check for resource kit. Both should work fine once Lync is installed.

  6. Caleb Baker
    April 5, 2013 at 2:50 pm | #10

    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?

    • Pat Richard
      April 5, 2013 at 2:51 pm | #11

      Not aware of a requirement that it be on c:. You could edit the script to that it installs it elsewhere.

  7. April 30, 2013 at 4:32 am | #12

    Hi, great script! I have tested office web app installation, but i think the script is missing the windows features InkandHandwritingServices.

  8. Chris Elliott
    April 30, 2013 at 1:55 pm | #16

    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.

  9. May 6, 2013 at 6:37 am | #17

    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
    WARNING: You must restart this server to finish the installation process.
    Installing RTCLocal instance. This will take several minutes.
    Folder: “c:\_Install” does not exist, creating…Done!
    File: SQLEXPR_x64_ENU.exe does not exist, downloading…Done!
    Installing LyncLocal instance. This will take several minutes.
    File already exists
    Installing RTC instance. This will take several minutes.
    Installing SQL Management Studio. This will take several minutes.
    Folder: “c:\_Install” exists.
    File: SQLManagementStudio_x64_ENU.exe does not exist, downloading…Done!
    Executing Install
    Installing Microsoft Silverlight
    Folder: “c:\_Install” exists.
    File: Silverlight_x64.exe does not exist, downloading…Done!
    File: Silverlight_x64.exe…………………………………[installed!]

    • Pat Richard
      May 6, 2013 at 8:13 am | #18

      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.

      • May 7, 2013 at 2:17 pm | #19

        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
        WARNING: You must restart this server to finish the installation process.
        Installing RTCLocal instance. This will take several minutes.
        Folder: “c:\_Install” does not exist, creating…Done!
        File: SQLEXPR_x64_ENU.exe does not exist, downloading…Done!
        Installing LyncLocal instance. This will take several minutes.
        File already exists
        Installing RTC instance. This will take several minutes.
        Installing SQL Management Studio. This will take several minutes.
        Folder: “c:\_Install” exists.
        File: SQLManagementStudio_x64_ENU.exe does not exist, downloading…Done!
        Executing Install
        Installing Microsoft Silverlight
        Folder: “c:\_Install” exists.
        File: Silverlight_x64.exe does not exist, downloading…Done!
        File: Silverlight_x64.exe…………………………………[installed!]

        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.

        • Pat Richard
          May 7, 2013 at 2:29 pm | #20

          Thanks. I think I’ve got that resolved in an upcoming release (probably Friday). I appreciate the comments!

  10. May 7, 2013 at 6:33 am | #21

    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”

  11. May 12, 2013 at 11:13 am | #22

    Thanks for updated script. The -standard switch no longer works? How are the standard options install selected?

    • Pat Richard
      May 12, 2013 at 11:16 am | #23

      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.

  12. May 12, 2013 at 11:16 am | #24

    Ah just got to the prompt asking if it was standard server… very cool!

  13. June 4, 2013 at 6:05 pm | #25

    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 !

  14. June 5, 2013 at 4:45 pm | #26

    Pat –
    VERY nice work.

  15. June 12, 2013 at 3:37 am | #27

    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?

    • Pat Richard
      June 15, 2013 at 10:52 am | #28

      It does not enter any key. Nor is one needed, I believe.

  16. Corey McClain
    • Pat Richard
      July 5, 2013 at 5:14 pm | #30

      Not sure I’m going to be able to get to that anytime soon. I don’t have a lab environment to test that.

      • Corey McClain
        July 17, 2013 at 9:12 am | #31

        #19 Has a spelling error: The term ‘Set-ModuleStatue’ is not recognized as the name of a cmdlet

        • Pat Richard
          July 17, 2013 at 9:18 am | #32

          Thanks Corey. I’ve updated my copy and will get a new version out soon.

  17. Jeffcsp
    July 30, 2013 at 9:27 am | #33

    Testing the latest 1.7, the sql express path cannot contain any spaces. Fails the validation line 35.

    • Pat Richard
      July 31, 2013 at 9:37 am | #34

      Looks like I have this resolved in v1.8, which should be out in the next day or so.

  18. September 13, 2013 at 11:49 am | #35

    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

    • Pat Richard
      September 13, 2013 at 12:06 pm | #36

      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.

  19. Andrew Burt
    October 22, 2013 at 3:26 pm | #37

    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”

    • Pat Richard
      October 22, 2013 at 3:36 pm | #38

      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.

      • Andrew Burt
        October 22, 2013 at 5:23 pm | #39

        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.

        • Pat Richard
          October 22, 2013 at 5:28 pm | #40

          I would drop that last zero to include service packs versions.

          • Andrew Burt
            October 22, 2013 at 6:15 pm | #41

            True! Thanks again. Will let you know if I encounter any 2012 R2 oddities during my testing.

  20. Mike
    November 5, 2013 at 10:29 am | #42

    This script is wonderful. I have been struggling to get the prerequisites installed and this does al lthe work. Thank you

  21. Ronald
    November 12, 2013 at 9:19 am | #43

    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.

    • Pat Richard
      November 25, 2013 at 12:06 pm | #44

      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.

  22. Bryan
    November 25, 2013 at 11:58 am | #45

    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?

    • Pat Richard
      November 25, 2013 at 12:03 pm | #46

      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.

      • Bryan
        November 25, 2013 at 12:06 pm | #47

        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.

        • Pat Richard
          November 25, 2013 at 12:09 pm | #48

          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.

          • Bryan
            November 25, 2013 at 12:11 pm | #49

            Lucky them – I’m going to be stuck on 2008 R2 for the forseeable future. Oh well – thanks for your advice.

  23. December 3, 2013 at 1:54 pm | #50

    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?

  24. Pat Richard
    December 3, 2013 at 3:33 pm | #51

    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.

  25. January 9, 2014 at 10:23 pm | #52

    Options 13(help) and 16(desktop tiles) in the script menu is opposite of blog description.

    • Pat Richard
      January 9, 2014 at 11:55 pm | #53

      Thanks. I’ve updated the article.

  26. Alessandro
    January 10, 2014 at 12:14 pm | #54

    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

    • Pat Richard
      January 10, 2014 at 12:21 pm | #55

      Yeah, that’s actually already fixed in v2.2, which should be out as soon as I add one more feature.

  27. June 12, 2014 at 3:37 am | #56

    Your absolutely right, you do not require a key for Office Web Apps.

  28. June 18, 2014 at 10:13 am | #57

    awesome script!
    how about adding “create the file share store” ?

    with the New-SmbShare command it’s easier then ever to script :)

    • Pat Richard
      June 18, 2014 at 10:28 am | #58

      I have been looking at that for a while. I suppose it’s time I took the plunge and implemented it.

      • June 18, 2014 at 10:32 am | #59

        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…

        • Pat Richard
          June 18, 2014 at 10:40 am | #60

          I don’t believe there are any Write-Error commands. Anything that uses -NoConsole and -Indent is for my Write-Log function.

          • June 18, 2014 at 10:46 am | #61

            sorry, it appears just once.. line 1664 :)

  29. Pat Richard
    June 18, 2014 at 10:48 am | #62

    Yeah, that was already resolved in v2.7. Thanks.

  30. Japheth Nolt
    July 16, 2014 at 11:33 am | #63

    In v2.7, Option 20 doesn’t seem to work….appears like a variable is misspelled

    $initanswer instead of $intanswer

    • Pat Richard
      July 16, 2014 at 1:23 pm | #64

      You are correct. It will be fixed in v2.8. Thanks for reporting it!

  31. July 25, 2014 at 6:18 am | #65

    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!

    • Pat Richard
      July 25, 2014 at 8:07 am | #66

      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.

    • August 18, 2014 at 8:28 pm | #67

      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.

      • Pat Richard
        August 18, 2014 at 9:02 pm | #68

        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.

  32. Michael
    August 8, 2014 at 3:07 pm | #69

    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??

    • Pat Richard
      August 25, 2014 at 9:42 pm | #70

      In theory, this might work. But untested.
      $PolicyEntry = New-CsClientPolicyEntry -Name EnablePresencePhotoOptions -Value True
      $PolicyObject = Get-CsClientPolicy -Identity Global
      Set-CsClientPolicy -Instance $PolicyObject

  33. August 25, 2014 at 9:35 pm | #71

    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?



    • Pat Richard
      August 25, 2014 at 9:39 pm | #72

      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.

  34. September 17, 2014 at 4:10 am | #73


    Is it possible to adjust the path of where OWAS Server is installed to ?

    • Pat Richard
      September 17, 2014 at 8:22 am | #74

      If you install it to anyplace other than the system drive, you’ll have inconsistent results.

      • September 17, 2014 at 9:26 am | #75

        What do you mean by “inconsistent result” ?

        By using manual install, the OWAS install, allows you to install to any drive.

        • Pat Richard
          September 17, 2014 at 9:30 am | #76

          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.

  35. SP
    October 16, 2014 at 3:01 pm | #77

    Pat, I do not see v3.0 on this page? Is there a new location, where we can download this script?

    Thank you,

    • Pat Richard
      October 16, 2014 at 3:08 pm | #78

      My bad. Check the page now.

      • Andrew Burt
        October 16, 2014 at 3:09 pm | #79

        Legend! Thanks again for all your awesome work Pat!

  36. SP
    October 16, 2014 at 5:26 pm | #80

    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.


  37. Mahmoud Badran
    October 29, 2014 at 12:07 pm | #81

    Thank you for the beautiful work :) – saves tons of time

  38. November 10, 2014 at 1:49 pm | #82

    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.


    • Pat Richard
      November 10, 2014 at 1:52 pm | #83

      -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.

      • November 10, 2014 at 2:04 pm | #84

        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.

        • Pat Richard
          November 10, 2014 at 2:05 pm | #85

          Just mount the DVD and point -Win2012Source to the root of the drive.

  39. Maurice Heine
    November 12, 2014 at 9:47 am | #86

    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?

  40. Asmer
    December 9, 2014 at 8:44 am | #87


    This means that menu choice 5 (Install Office Web Apps server) cannot download img file.

    • Pat Richard
      December 9, 2014 at 10:09 am | #88

      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.

  1. February 8, 2013 at 10:35 am | #1
  2. February 12, 2013 at 12:28 pm | #2
  3. February 21, 2013 at 10:30 pm | #3
  4. March 11, 2013 at 9:23 pm | #4
  5. March 13, 2013 at 8:33 pm | #5
  6. March 19, 2013 at 12:30 pm | #6
  7. May 15, 2013 at 4:13 pm | #7
  8. May 27, 2013 at 10:37 am | #8
  9. July 14, 2013 at 8:30 pm | #9
  10. December 10, 2013 at 1:15 pm | #10
  11. March 6, 2014 at 4:17 pm | #11
  12. April 1, 2014 at 12:28 pm | #12
  13. May 13, 2014 at 4:30 pm | #13
  14. May 22, 2014 at 10:39 pm | #14
  15. June 10, 2014 at 9:14 am | #15
  16. June 24, 2014 at 8:13 am | #16
  17. July 7, 2014 at 10:32 am | #17
  18. July 9, 2014 at 11:04 am | #18
  19. July 9, 2014 at 6:51 pm | #19
  20. September 7, 2014 at 12:51 pm | #20

Leave a Reply