Day: June 9, 2014

Out of date sources for an up-to-date template?

Say you’re trying to speed up your VM deployments and create a template with Windows Server 2012 or 2012 R2, and in the process to clean up some valuable HD space you run something like the following:

Get-WindowsFeature | Where-Object -FilterScript { $_.Installed -Eq $FALSE } | Uninstall-WindowsFeature –Remove

What that’ll do is remove the binaries off any uninstalled feature and save you a few gigs… BUT you will need the media, or the sources in a share, any time you want to install a feature, which is fine… as long as your template does not get updated. The moment you run Windows Update and go through the motions, your media will no longer work if you want to add features, and installations will fail with something like this:

Error: 0x800f081f

The source files could not be found.
Use the “Source” option to specify the location of the files that are required to restore the feature. For more information
on specifying a source location, see http://go.microsoft.com/fwlink/?LinkId=243077.

To update your sources so that you can use them when installing features, you can use the install.wim file on your media and grab the latest patches using WSUS Offline Updater (http://www.wsusoffline.net/), then merge the updates with the sources. Here’s how:

  • Copy the Sources\install.wim file from your Windows Server 2012 or 2012 R2 DVD media to somewhere in your hard drive.
  • Create a temporary folder, let’s call it C:\Win2012R2
  • Remove the read-only attributes of your local install.wim file because we will be modifying it
  • Run dism.exe /get-wiminfo /wimfile:C:\install.wim and take note of the Index for the edition you’re using
  • Run dism.exe /mount-wim /WimFile:C:\install.wim /index:4 /mountDir:C:\Win2012R2. Note i’m using Index 4, which is for Datacenter (non-core)
  • Run WSUS Offline and download all patches for the edition you’re using, and create an ISO from them
  • Mount the ISO with the updates, then run dism.exe /image:C:\Win2012R2 /Add-Package /PackagePath:F:\w63-x64\glb. In my case, the ISO was mounted on drive F:
  • Run the previous command at least twice. There are times where updates won’t slipstream into the sources unless they are at the right version. This is the case with Update 1 for Server 2012 R2.
  • Once all updates are injected, run dism.exe /Unmount-Wim /MountDir:C:\Win2012R2 /commit which will write the install.wim file back with changes and is ready for use.

When it comes time to install features, just use Add-WindowsFeature with -source:wim:\\server\share\install.wim:4 (note the Index number at the end).

For more detail, you can check out this TechNet article in combination with WSUS Offline to help you with the patch downloads.

Thanks for reading!

Oops! when you forget to update Lync’s Back End DB

After applying Cumulative Update packages to Lync 2010 or 2013 topologies, there is a required step to update the back-end databases and the Central Management Store (CMS). If you forget because you’re either lazy or rushed, you’ll start noticing some things don’t work as expected, like the Call Park Service and the Response Group Service. Here’s an indication that your DB needs to be upgraded:

2014-06-09 13_34_18-MobaXterm Professional

Event ID 31059 by the LS Call Park Service clearly tells us to Upgrade the databse to CU1. See below for the cmdlets to run, but please refer to Microsoft’s official upgrade documentation for some important considerations:

Lync 2013 Standard Edition:

  • Install-CsDatabase -ConfiguredDatabases -SqlServerFqdn SE.FQDN -Verbose
  • Install-CsDatabase -CentralManagementDatabase -SqlServerFqdn CMS.FQDN -SqlInstanceName DBInstanceName -Verbose
  • Enable-CsTopology
  • %ProgramFiles%\Microsoft Lync Server 2013\Deployment\Bootstrapper.exe

Lync 2013 Enterprise Edition:

  • Install-CsDatabase -ConfiguredDatabases -SqlServerFqdn FEBE.FQDN -Verbose
  • Install-CsDatabase -DatabaseType PersistentChat -SqlServerFqdn PChatBE.fqdn -SqlInstanceName DBInstance -Verbose
  • Install-CsDatabase -ConfiguredDatabases -SqlServerFqdn SQLServer.FQDN -Verbose
  • Enable-CsTopology
  • %ProgramFiles%\Microsoft Lync Server 2013\Deployment\Bootstrapper.exe