RSS Subscription 168 Posts and 2,769 Comments

Archive for September, 2012

New-CSMultiRegionNetwork.ps1 – Automate Lync Network Site and Subnet Creation

To Automate Lync Network Site and Subnet Creation with only one Lync Network Region, please see my New-CSSingleRegionNetwork.ps1 script here.

With Lync Server 2010 and 2013, there are Lync Regions, Lync Sites, and Lync Subnets.  There are three functions in which these can be utilized:

  • Call Admission Control
  • Controlling Media Bypass Behavior
  • Ability to assign a Location Policy to Network Sites so users 911 will route to a given gateway based on the Network Site they are currently located on
  • Provide Site to Site Media Quality behavior in the Monitoring Server Location Reports

Active Directory (AD) is a good starting point to gather all the information on your Sites as well as your Subnets.

Script Functionality

To help automate this process, I wrote the New-CSMultiRegionNetwork.ps1 script.  The purpose of this script is to:

  • Make a connection to AD and record every AD subnet that exists and its corresponding AD Site
  • Export Data to CSV
  • Allows you to specify Lync Network Regions and their corresponding Lync Central Sites
  • Allows you to assign Location Policies to Sites (Note: The Location Policies need to be created beforehand as the script will not create Location Policies)
  • Allows you to assign Bandwidth Policies to Sites (Note: The Bandwidth Policies need to be created beforehand as the script will not create Bandwidth Policies)
  • Will create the Lync Network Regions and assign them to the corresponding Lync Central Site as defined in the CSV
  • Will create the AD Site in Lync Network Sites
    • Something to note is that AD Sites support non-alphanumeric characters such as a hyphen while Lync Network Sites do not support non-alphanumeric characters.  Because of this, this script will create the Lync Network Site without any non-alphanumeric characters.  It is safe to re-run the script more than once as the script will always take notice that an AD Site with non-alphanumeric characters will match a Lync Network Site with non-alphanumeric characters.  Important: Be sure that you don’t have an AD Site that would match another AD Site if non-alphanumeric characters were to be removed.  An example if you had two AD Sites: One called Site01 and another called Site-01.  When the process to remove non-alphanumeric characters occur, they will both conflict.
    • If any Lync Network Sites are created, the script will pause for 15 seconds to allow the Lync Network Sites to instantiate.  If no Lync Network Sites exist, it will move immediately on to subnets.
    • It will create the Lync Network Subnets and assign them to their corresponding Lync Network Site
    • It will assign the Lync Bandwidth Policies and/or Lync Location Policies as defined in the CSV

Miscellaneous Notes

Something to note is that the script will function with one or more Lync Network Regions.  If you have only one Lync Network Region, please run my New-CSSingleRegionNetwork.ps1 script which will automate the entire AD Site and Subnet creation without any CSV file tweaking needed. Please go here for this script.

Video Demonstration

Download

v1.0 – New-CSMultiRegionNetwork.zip

Changelog

v1.0 – Script Creation

Share

Manually enable Appear Offline in Lync 2013 Preview via Registry

Lync 2013, just as with previous releases, allows the ability to Appear Offline. And just as with previous releases, you can enable this functionality in the Lync Client Policies. For information on how Lync Client Policies work, see my post here.  To enable Appear Offline through Client Policie against the Global Policy, use the following command:

Get-CSClientPolicy | Set-CSClientPolicy -EnableAppearOffline $true

This will require a Lync 2013 client restart.

As an Administrator, you may not want to make this change to a Client Policy as the goal of Lync is to promote collaboration, not inhibit it by having users Appear Offline and hide from other users.  At the same time, you may want to enable it for a user or two at request and won’t want to have to bother providing this small group of users their own Client Policy.  Lync 2010 provided the ability to do that via registry key.  Mike Pfeiffer provides a great article on Lync 2010 for setting the Lync 2010 registry key to manually enable Appear Offline in Lync 2010.  You can see his article here.

The goal of this article is to show how to do the same in Lync 2013.  Because Lync 2013 is now a part of Office 2013, Lync 2013 registry items are now under the Office 2013 registry section (Office 15.0).  There are two ways to set this registry:

  1. Cmd.exe
  2. Regedit.exe

Using Cmd.exe

The type the following command:

Reg Add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Office\15.0\Lync" /V "EnableAppearOffline" /D 1 /T REG_DWORD /F

Using Regedit.exe

  1. Start regedit.exe
  2. In Registry Editor, expand HKEY_LOCAL_MACHINE, expand Software, expand Policies, expand Microsoft, expand Office, expand 15.0, expand Lync
  3. Right-click the Lync registry key, point to New, and then click DWORD (32-bit) Value
  4. After the new value is created, type EnableAppearOffline to rename the value.
  5. Double-click the new EnableAppearOffline registry value.
  6. After the new value is created, type EnableAppearOffline to rename the value.
  7. Double-click the new EnableAppearOffline registry value.
  8. In the Edit DWORD (32-bit) Value dialog box, type 1 in the Value data box, and then click OK.

Bug in Lync 2013 Preview

At the current time of this writing, the latest version of Lync 2013 is Lync 2013 Preview.  In the current Lync 2013 Preview, there is currently a bug that prevents the Appear Offline option from being displayed in the Presence drop down selection.

The workaround until this issue is fixed is that you can set Appear Offline in the taskbar by hovering over the Lync 2013 Preview icon and choosing the Appear Offline option there.

Share

New-CSSingleRegionNetwork.ps1 – Automate Lync Network Site and Subnet Creation

To Automate Lync Network Site and Subnet Creation with more than one Lync Network Region, please see my New-CSMultiRegionNetwork.ps1 script here.

With Lync Server 2010 and 2013, there are Lync Regions, Lync Sites, and Lync Subnets.  There are three functions in which these can be utilized:

  • Call Admission Control
  • Controlling Media Bypass Behavior
  • Ability to assign a Location Policy to Network Sites so users 911 will route to a given gateway based on the Network Site they are currently located on
  • Provide Site to Site Media Quality behavior in the Monitoring Server Location Reports

Active Directory (AD) is a good starting point to gather all the information on your Sites as well as your Subnets.

Script Functionality

To help automate this process, I wrote the New-CSSingleRegionNetwork.ps1 script.  The purpose of this script is to:

  • Make a connection to AD and record every AD subnet that exists and its corresponding AD Site
  • Will create the AD Site in Lync Network Sites
    • Something to note is that AD Sites support non-alphanumeric characters such as a hyphen while Lync Network Sites do not support non-alphanumeric characters.  Because of this, this script will create the Lync Network Site without any non-alphanumeric characters.  It is safe to re-run the script more than once as the script will always take notice that an AD Site with non-alphanumeric characters will match a Lync Network Site with non-alphanumeric characters.  Important: Be sure that you don’t have an AD Site that would match another AD Site if non-alphanumeric characters were to be removed.  An example if you had two AD Sites: One called Site01 and another called Site-01.  When the process to remove non-alphanumeric characters occur, they will both conflict.
    • If any Lync Network Sites are created, the script will pause for 15 seconds to allow the Lync Network Sites to instantiate.  If no Lync Network Sites exist, it will move immediately on to subnets.
    • It will create the Lync Network Subnets and assign them to their corresponding Lync Network Site

Miscellaneous Notes

Something to note is that the script will only function with one Lync Network Region.  There are several reasons why:

  • I wanted this script to be completely automated.  If you have one Region, run the script and the script will automatically create all Lync Network Sites, Lync Network Subnets, and associate everything accordingly without any administrative intervention whatsoever.
  • I thought about checking if multiple Regions exist and if they do, prompt what Network Region needs to be assigned to a Network Site every time a Network Site were to be created.  If you had a ton of Network Sites, this would be incredibly annoying.  Because of this, I will be making another script sometime soon that will run in an Import and Export Mode.  The Export Mode would dump all the AD Sites and AD Subnets to CSV where you can then create a Region Field.  You would then be able to run the script in Import Mode which would then create the Network Sites, Network Subnets, and associate everything accordingly to what is in the CSV.

Video Demonstration

Download

v1.0 – New-CSSingleRegionNetwork.zip

Changelog

v1.0 – Script Creation

Share