tag:blogger.com,1999:blog-2156539095375223979.post2607200819461528552..comments2024-03-20T03:35:01.157-04:00Comments on Ken's Unified Communications Blog: Automatically Creating Lync Sites and Subnets using AD SitesKen Laskohttp://www.blogger.com/profile/14298995806059683301noreply@blogger.comBlogger4125tag:blogger.com,1999:blog-2156539095375223979.post-63733109148487957572013-06-11T07:47:43.052-04:002013-06-11T07:47:43.052-04:00Gladly!Gladly!Greig Sheridanhttps://greiginsydney.comnoreply@blogger.comtag:blogger.com,1999:blog-2156539095375223979.post-85898691469378882982013-06-03T20:38:21.020-04:002013-06-03T20:38:21.020-04:00Thanks Greig!
If you don't mind, can I inco...Thanks Greig! <br />If you don't mind, can I incorporate these changes into the script posted here?<br /><br />KenKen Laskohttps://www.blogger.com/profile/14298995806059683301noreply@blogger.comtag:blogger.com,1999:blog-2156539095375223979.post-26767910887874656942013-06-02T23:54:49.877-04:002013-06-02T23:54:49.877-04:00Fantastic script Ken - just what the Dr ordered......Fantastic script Ken - just what the Dr ordered...<br /><br />I managed to break it quickly because my sole AD site in my Lab has dashes in the name, which is an invalid character in Lync:<br /><br />New-CSNetworkSite : Cannot create item "My-AD-Site": "Invalid value for NetworkSiteID: Must be a string of at most 32 characters. Only letters, digits, "_", ".", and spaces are permitted."<br /><br /><br />I added a couple of lines to trap this, as well as check for maximum length (which it brutally chops at 32 chars):<br /><br /># Create Lync network sites based on AD site<br /> $SiteObj = Get-ADObject $Site.distinguishedName -properties "siteObjectBL", "description" <br /> $SiteObjName = [regex]::replace($SiteObj.Name, "([^0-9a-zA-Z_. ])" , "")<br /> If ($SiteObjName.Length -gt 32){$SiteObjName = $SiteObjName.SubString(0,32)}<br /> New-CSNetworkSite -NetworkSiteID $SiteObjName -Description $SiteObj.Description -NetworkRegionID $SiteName -ea si<br /><br /><br />I had to create $SiteObjName as a new variable as I wasn't able to change the existing $SiteObj.Name<br /><br />I also took the liberty of adding "-ea si" to the end of each of the "new-[object]" lines, and that way the script doesn't output an error if the object already exists (because you might have already run the script before).<br /><br />Thanks again. - Greig.Greig Sheridanhttps://greiginsydney.comnoreply@blogger.comtag:blogger.com,1999:blog-2156539095375223979.post-66483816430487234342013-04-01T14:00:05.980-04:002013-04-01T14:00:05.980-04:00Great script Ken. Iv also thought the same regardi...Great script Ken. Iv also thought the same regarding Sites/Services and why Lync isn't incapable of using this for its sub-net configuration. Maybe its a deliberate omission from the Lync team. As as you rightly say Exchange moved to this model since Exchange 2007. But may be its because in many environments iv worked in iv yet to see sites and services configured correctly to match the underlying network. Bearing in mind how important voice is would you want it to be left at the behest of a AD admin who hasn't configured Sites and Services properly? Either way i hope this feature does appear in future version(s). It would certainly save a lot of manual labor as does your script. scurlaruntingshttps://www.blogger.com/profile/13983629861168930782noreply@blogger.com