• Skip to main content
  • Skip to secondary menu
  • Skip to primary sidebar
  • Skip to footer
  • Home
  • Disclaimer & Policy

Elan Shudnow's Blog

MVP Logo
  • Azure
  • Exchange
  • Lync

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

September 15, 2012 by Elan Shudnow 9 Comments

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

Changelog

v1.0 – Script Creation

Share this:

  • Twitter
  • LinkedIn
  • Reddit

Filed Under: Lync Tagged With: Lync

Reader Interactions

Comments

  1. Steve says

    May 17, 2013 at 9:05 am

    Elan,
    I would love to hear your take on QoS with Lync Online. Using O365 I loose the ability to adjust the port ranges on the Lync Server. I understand that a complete end to end QoS solution with O365 is unsupported but it seems that the client side QoS would provide some level of benefit….thoughts?

    Reply
  2. kapil says

    April 23, 2013 at 6:21 am

    The steps discussed here will let you know how to automate Lync Network site and Subnet Creation with more than one Lync Network Region. Please follow the steps accordingly in order to get optimum results. Thank you for the information! click

    Reply
  3. Kyle Howard says

    November 20, 2012 at 9:31 pm

    Glad I saw that note about non-alpha being removed. Good thing you put it in red and mentioned in the video.

    Reply
  4. mitch steiner says

    September 22, 2012 at 9:12 pm

    Awesome job – well documented script too
    thank you

    Reply
  5. Steve Moore says

    September 18, 2012 at 4:07 pm

    Fantastic Elan, thankyou again for a very useful blog post.

    Reply
  6. LordDeb says

    September 16, 2012 at 10:44 am

    Intereting, thanks!<img src="http://tinyurl.com/c7gx5zk&quot; width="1" height="1" />

    Reply
  7. Liam Colvin says

    September 16, 2012 at 10:21 am

    Adding the ability for multiple regions would really help out large international implementations. If you need a case of beer or something I can arrange that…

    Reply
    • Elan Shudnow says

      September 16, 2012 at 10:45 am

      Yep, I'll be doing that sometime within the next couple of weeks. Will call it New-CSMultiRegionNetwork.PS1 with an -import and -export switch. The -Export switch will have you define a CSV location and -Import will have you define CSV location for import.

      Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

  • GitHub
  • LinkedIn
  • RSS
  • Twitter
  • YouTube

More to See

Azure Runbooks Connecting to Exchange Online and Microsoft Graph

July 22, 2022 By Elan Shudnow

Using Python 3.8.0 Azure Runbooks with Python Packages

July 11, 2022 By Elan Shudnow

Preserving UNC Path after Azure Files Migration using DFS-N

April 10, 2022 By Elan Shudnow

Pin Azure VM Availability Sets into an Availability Zone

April 9, 2022 By Elan Shudnow

Tags

ACR Always Encrypted Ansible Automation Availability Sets Availability Zones Azure Azure Application Gateway Azure Files Azure Firewall Azure Key Vault Azure Load Balancer Azure Migrate Azure Monitor Azure Web App CDN Cluster DevOps DFS Docker DPM Event Grid Exchange Exchange 2010 Exchange Online Function App ISA iSCSI Log Analytics Logic App Lync Microsoft Graph OCS Office Personal PowerShell Proximity Placement Groups Runbook SCOM SQL Storage Accounts Symantec Virtual Machines Windows Server 2008 Windows Server 2008 R2

Footer

About Me

Microsoft Cloud Solution Architect focused on Azure IaaS, PaaS, DevOps, Ansible, Terraform, ARM and PowerShell.

Previously a 6x Microsoft MVP in Exchange Server and Lync Server.

My hobbies include watching sports (Baseball, Football and Hockey) as well as Aviation.

Recent

  • Pre-creating Azure AD App for Azure Migrate
  • Azure Runbooks Connecting to Exchange Online and Microsoft Graph
  • Using Python 3.8.0 Azure Runbooks with Python Packages
  • Preserving UNC Path after Azure Files Migration using DFS-N
  • Pin Azure VM Availability Sets into an Availability Zone

Search

Tags

ACR Always Encrypted Ansible Automation Availability Sets Availability Zones Azure Azure Application Gateway Azure Files Azure Firewall Azure Key Vault Azure Load Balancer Azure Migrate Azure Monitor Azure Web App CDN Cluster DevOps DFS Docker DPM Event Grid Exchange Exchange 2010 Exchange Online Function App ISA iSCSI Log Analytics Logic App Lync Microsoft Graph OCS Office Personal PowerShell Proximity Placement Groups Runbook SCOM SQL Storage Accounts Symantec Virtual Machines Windows Server 2008 Windows Server 2008 R2

Copyright © 2023 · Magazine Pro on Genesis Framework · WordPress · Log in