Stupid CsAnalogDevice Tricks

No need to throw away all the old phones - you've got CsAnalogDevice!

Can be integrated into Skype for Business with CsAnalogDevice

Anthony Caragol recently set the Skype for Business community a little challenge:

Never dare a Texas girl.

Previously, a local admin at one of the sites we recently rolled out Skype for Business telephony at needed some mobile phones to be directly callable from the client AND to be identified by the same name when calling Skype for Business users. I vaguely recalled there being some way to integrate older phones and faxes and hit upon CsAnalogDevice.

Like CsCommonAreaPhone, a CsAnalogDevice is an Active Directory Contact object and is completely inaccessible from the web admin interface, but unlike CsCommonAreaPhone, is just a pointer to a phone number.

Here’s how you make one for a German mobile with 0151/12345678 – +49 (151) 1234678:


New-CsAnalogDevice LineURI 'tel:+4915112345678' DisplayName 'Maintenance Crew' `
OU 'mandie.net/Contacts/Phones' Gateway 'nue-sbc01.mandie.net' SipAddress `
'sip:maintenancecrew@mandie.net' RegistrarPool 'nue-FE01.mandie.net' `
AnalogFax:$false DomainController nuedc01

Wait a bit for address book propagation, and you can then click to make Skype calls like any other Skype for Business endpoint.

Back to Anthony’s question – you can only forward to a single number in the client and in SEFAUtil, and delegates and team members must be proper SIP addresses (will need to see if an external SIP address can be shoe-horned in those lists…)

I made CsAnalogDevices for my mobile and home phones, waited awhile, then used SEFAUtil to add their SIP addresses as my “delegates” and set immediate forwarding to delegates. Result! Both rang when I called my main number, and I was able to answer on either.

In the desktop client, I could see both display names as my delegates.

To test:

  1. Can Analog Devices be added as delegates and team members from the desktop client instead of SEFAUtil?
  2. Does this still work when the Analog Devices are on different PSTN gateways?
  3. Is this available in Skype for Business Online?

CsAnalogDevices can make any phone number, internal or external, a more integrated part of your Skype for Business environment.

What weird and/or wonderful use have you found for CsAnalogDevice? Any other obscure endpoint types?

Advertisement

Is that Skype for Business (Lync) Number Free?

Get-CsAdPrincipal is a tragically underused cmdlet. Absent a fully generic Get-CsEndpointObject, it’s the next best thing to Get-ADObject, and is killer when you have no idea what you’re looking for – a User, a Common Area Phone, Conference Dialin Number, Response Group or some crazy custom endpoint used in a Skype-enabled application, especially if all you care about is seeing if a number is available. If you see “485 Ambiguous” in a SIP trace, this will help you figure out who (and/or what) all has this number, and why Skype isn’t quite sure which one the caller wanted to reach.

There are several scripts for testing each of the Skype for Business object types one by one, and I give some of my favorites at the end of the post; the Get-CsAdPrincipal approach is faster in automation if you’re mostly interested in whether a number is consumed at all, and aren’t concerned with *what* exactly is consuming it.

Get-CsAdPrincipal -LDAPFilter '|(msrtcsip-line=tel:+499112224000*)(msrtcsip-privateline=tel:+499112224000*)'

The LDAP query is checking both the MsRTCSIP-Line and MsRTCSIP-PrivateLine attributes, and there is an asterisk at the end in case the extension was specified separately: tel:+499112224000 and tel:+499112224000;ext=4000 are functionally the same number, but do not look the same to Skype for Business! This is common in places where each line can be directly dialed from outside – that is, much of Europe. I used the attribute names in all lowercase because the mixed-case versions did not work.

If all you wanted was a quick way to check if a number is free or not, you can quit reading now and get back to writing your provisioning script 🙂 If you want to know a bit more about Skype for Business objects, as well as see some really nice stuff for viewing your number pool, stay with me…

Continue reading

Quickly turn SkypeUI on and off without opening Regedit – Skype for Business Preview

The Skype for Business Technical Preview has been pretty great so far, and if I had my choice, I’d use it 100% of the time (get it here). However, I occasionally need to take screenshots for our end users, most of whom have recently been upgraded to Lync 2013 from Office Communicator 2007 R2! Several people have posted the proper registry key to add and change in order to switch UIs (great example here), but frankly, opening Regedit always makes me a tiny bit nervous, even if I am running as a non-admin user. If you are not running as a non-admin user for regular email/Lync/internetting, please think very hard about why!

Here are some little PowerShell functions I’ve written to quickly make this change and restart the Lync/Skype for Business client (can also be downloaded from TechNet Gallery)


# QuickSkypeUISwitch.ps1, Version 1.01
# Amanda Debler, http://mandie.net
# now with no-so-new Provider hotness - thanks, Kevin Bird (http://kb-kb.com), for reminding me that providers exist 🙂


# See if the key exists, and if so, what its current value is
 
function Test-SkypeUIRegKey {
    # old cmd-style registry query
    # reg query "HKCU\Software\Microsoft\Office\Lync" /v EnableSkypeUI
    try {
        get-ItemProperty HKCU:\Software\Microsoft\Office\Lync -Name EnableSkypeUI
        }
    catch [System.Exception] {
    "Registry Key does not exist or cannot be accessed - if Skype for Business UI isn't coming up, try Enable-SkypeUI"
    }
}
 
# Lazy assumption that you have Lync set to autostart, plus
# trickery to find, kill and restart your Lync/Skype4B client,
# because I have no idea where you installed it
 
function Restart-SkypeForBusiness {
    $lyncProcess = Get-Process -Name Lync
    $lyncProcess |  Stop-Process
    Start-Process -FilePath $lyncProcess.Path
}
 
# The /f means force - don't care if you have a key there already or not
 
function Enable-SkypeUI {
    # old but not busted cmd-style registry key insert
    # reg add "HKCU\Software\Microsoft\Office\Lync" /v EnableSkypeUI /t REG_BINARY /d 00000001 /f

    # Note the commas in the Value - Binary registry keys are treated as 4 bytes
    New-ItemProperty HKCU:\Software\Microsoft\Office\Lync -Name EnableSkypeUI -Value 00,00,00,01 -PropertyType Binary -Force
    Restart-SkypeForBusiness
}
 
function Disable-SkypeUI {
    # reg add "HKCU\Software\Microsoft\Office\Lync" /v EnableSkypeUI /t REG_BINARY /d 00000000 /f
    New-ItemProperty HKCU:\Software\Microsoft\Office\Lync -Name EnableSkypeUI -Value 00,00,00,00 -PropertyType Binary -Force
    Restart-SkypeForBusiness
}

Get-CsTopologyFixed Loves Your Simple URLs!

Yes, I know there is no such thing as a tbxml tag. That doesn't mean that there shouldn't be.Remember how I was complaining last week about how Get-CsTopology -AsXml drops the whole SimpleUrlConfiguration node, which makes Topology Builder sad?

Fixed it!

You, too, can enjoy what I do in the evenings on my ridiculous lab machine and get your own readable (though read-only) .tbxml files right from PowerShell:

Get-CsTopologyFixed (hosted on TechNet Gallery)

It works for View-Only Administrators (CsViewOnlyAdministrator), as well as full CsAdministrator (or equivalent), so your telephone gal or Exchange guy can grab a copy whenever they need to check something or a consultant wants a copy so that they understand what’s going on with Lync in your environment. I have not tested it with an account that only has, for example, CsUserAdministrator or CsServerAdministrator.

For people who are not (yet) hard-core PowerShellers: this script is a function, not a standalone script. Running it “dot-sourced” will add the Get-CsTopologyFixed cmdlet to your current PowerShell session, or you can add the function to your Lync Server connection script. You need to either be on a computer with Lync Management Shell (part of the Lync management tools on the Lync Server installer image) or implicitly remoted to one that has it in order to access the native Lync Server cmdlets.

Here is the function to take the output of Get-CsSimpleUrlConfiguration and put it into an XML node, which my full script then drops into the rest of the Topology XML:

    function Convert-CsSimpleUrlConfigurationToXMLText { 
        $GetCsSimpleUrlConfiguration = Get-CsSimpleUrlConfiguration 
        $SimpleUrlConfigurationOut = "" 
        $simpleUrlConfigurationOut += '<SimpleUrlConfiguration xmlns="urn:schema:Microsoft.Rtc.Management.Settings.SimpleUrl.2008" UseBackendDatabase="false">' 
     
        foreach ($simpleUrl in $GetCsSimpleUrlConfiguration.SimpleUrl) { 
            $SimpleUrlConfigurationOut += "<SimpleUrl Component=`"$($simpleUrl.Component)`" Domain=`"$($simpleUrl.Domain)`" ActiveUrl=`"$($simpleUrl.ActiveUrl)`">" 
            foreach ($simpleUrlEntry in $simpleUrl.SimpleUrlEntry) { 
                $SimpleUrlConfigurationOut += "<SimpleUrlEntry Url=`"$($simpleUrlEntry.Url)`" />" 
            } 
            $SimpleUrlConfigurationOut += "</SimpleUrl>" 
        } 
 
        $SimpleUrlConfigurationOut += '</SimpleUrlConfiguration>' 
 
        $SimpleUrlConfigurationOut 
    }

I have no idea if it works (or is even necessary) on Lync Server 2010. If Microsoft will let me have a preview copy, I’d be willing to find out if it works (or is even necessary) on Skype for Business 😉

If you find something wrong with my script, or come up with an improvement, let me know!

Get-CsTopology Hates Your Simple URL Configuration

Yes, I know there is no such thing as a tbxml tag. That doesn't mean that there shouldn't be.

Yes, I know there is no such thing as a tbxml tag. That doesn’t mean that there shouldn’t be.

UPDATE – get the fix from the TechNet Gallery and read about it here!

Several of my Unified Communications team colleagues need to be able to get current copies of the topology on demand to hand to consultants or to just have some idea of what’s going on in our Lync world, but don’t have any business editing it and would rather not install the Lync Management Tools on their PCs. My team lead and I both thought that having a little script keep an up to date copy on our team’s SharePoint site was just the thing, and I pointed out that Get-CsTopology -AsXml should work quite nicely. *Should* being the important word in that sentence.

Get-CsTopology, like many things, is about 95% awesome. The 5% of not awesome is that it does not pull the Simple URLs. It fills in its best (and wrong) guess for the Phone access URLs, but shows that the Meeting URLs and the Administrative Access URL are missing, the first of which is a fatal flaw in a Lync topology.

Continue reading

Windows Fabric Gone Wild!

Does anyone know WHY Windows Fabric would generate logs like mad? Our Lync Front End servers have about 10 of these per DAY right now. I’ve not turned off the logging or changed it to circular as I want to have the logs on hand to send Microsoft if needed – instead, I’m moving them over to an empty volume with this script running as a scheduled task each night.

if (-not (Test-Path "E:\Windows Fabric Traces")) {
	New-Item -ItemType Directory -Name "E:\Windows Fabric Traces"
}
$fabrictraces = Get-ChildItem "c:\ProgramData\Windows Fabric\Fabric\log\Traces" | where { $_.name -like "fabric_traces_*"} | sort -Descending LastWriteTime
#skip the first two - one of them is the trace file in use, the other is the most recently full one
for ($i=2; $i -lt $($fabrictraces.count); $i++) { $fabrictraces[$i] | Move-Item -Destination "E:\Windows Fabric Traces\" }

$leasetraces = Get-ChildItem "c:\ProgramData\Windows Fabric\Fabric\log\Traces" | where { $_.name -like "lease_traces_*"} | sort -Descending LastWriteTime
for ($i=2; $i -lt $($leasetraces.count); $i++) { $leasetraces[$i] | Move-Item -Destination "E:\Windows Fabric Traces\" }

However, this is only treating the symptoms, not the cause, so the search continues…

Lync Phone Edition PIN Authentication and Cisco ACE Load Balancer – It’s About the Certificate Chain Group

This is truly the article I would have LOVED to have found when we first got the DHCP settings in for our Lync Phone Edition devices and other Lync phones, and were going crazy trying to figure out why the LPE devices were fine right after being tethered to a PC, but were not if someone logged in and out of them while disconnected and after rebooting. And that I sort of promised to write when I was raving about a certain switch.

The symptoms: Test-CsPhoneBootstrap works flawlessly. Other Lync phones can log on with extension and PIN. Your Lync Phone Edition device (in our case, the Polycom CX3000) will cheerfully log on with the extension and PIN if you’ve logged it in tethered to a PC via the PC’s Lync client first, but gives you “An account matching this phone number cannot be found. Please contact your support team” after a very quick flash of another error, “Account used is not authorized, please contact your support team” for the very same extension and PIN if you’ve logged out of the device and powered it down. I did what another admin did, taking a video on my phone, then replaying it really slowly – the time from entering the PIN to getting the final failure message was less than 4 seconds, and that was necessary to see the first failure message that briefly flashed on the screen.

Continue reading

Comparing Lync Policies – or How to Flip Just About Any Array of Hashtables in PowerShell

If you are reading this blog and can read German, I don’t need to tell you about msxfaq.de, former Exchange and now Lync MVP Frank Carius’ online (but not very alphabetical) encyclopedia of Exchange and Lync – it probably gets more page views in a day than this blog ever has. Even if you cannot read German, you have still probably run into it when searching for Exchange or Lync topics and then seriously wished you could read German – machine translation only goes so far.

Anyhow, one of the most helpful things he’s put out there and that I use all the time is a Swap-Table script. I wasn’t able to turn it up with “flip table in PowerShell” or “pivot PowerShell table” or any of several variations, so this is a little attempt to make that wonderful file findable for the English-speaking world. Scroll to the bottom and look for the “Code” section. You can make it a function in your PowerShell profile by putting the contents of that text file inside the curly braces {} of the following (code not posted here because plagiarism is evil):

function Swap-Table {
# contents of swap-table.1.0.ps1 go here

}

It has been particularly useful for comparing ClientPolicies and ConferencingPolicies in Lync, as ClientPolicy has over 70 attributes! Once you have the function in your session and you’re connected to Lync Management Shell, it works like this:

Get-CsClientPolicy | Swap-Table | Out-GridView

Deploying Deskphones for Lync? You Want This Switch!

Test-CsPhoneBootstrap said that we were doing the right thing. Jeff Schertz’s guide to configuring Lync for Lync Phone Edition devices said that we were doing the right thing. Elan Shudnow’s post about Cisco switches and PIN authentication said we were doing the right thing.

But our Lync Phone Edition devices just were NOT authenticating.

One of my network guys mirrored one of the wall ports for me, and I alternated between the happily-authenticating AudioCodes 420HD and the stubborn Polycom CX3000, capturing WireShark traces I could barely read (I’ve since gotten to know the handshake process those LPE devices need way better than I ever wanted to). But what a pain.

msxfaq.de, long-time Exchange and now Lync MVP Frank Carius’ mostly-German variety shop of Lync and Exchange experience to the rescue – most specifically, his page on port mirroring. He recommends the NetGear ProSafe Plus series, the least expensive of which is the 5-port, non-PoE (Power over Ethernet) version, the GS105E. If you can read German, he explains several other options, along with exploring how you might connect to it without using Adobe AIR (and Windows) and some possible security implications of it having a default, hardcoded password to a web interface (theoretically, someone could break in and set up mirroring). If you can’t read German, it’s still good for screenshots of how to set up the port mirroring on the ProSafe Plus switches.

I, on the other hand, found the GS108PE, with 4 PoE ports and 4 regular ones to be the right balance between cost and convenience. This means up to four phones plugged in at once, and without power adapters. The non-PoE (and less expensive) versions will require you to use the phones’ power adapters. Later, if you want VLANs, VLANs you can have.

Port Mirroring Screenshot

Port Mirroring made easy – too bad about the Adobe AIR interface…

Continue reading

August 2014 Lync Server 2013 CU Solves Address Book Delta Issue… Eventually.

The Address Book delta issue that we and so many other large Lync environments have experienced is resolved by the Lync Server 2013 Cumulative update for August 2014 – about 30 days after the update is installed. So, patience, Grasshoppers.

What should have been the early July 2014 Lync Server 2013 Cumulative Update became the mid August 2014 update, but we’re not complaining – it beats the early July update followed closely by the August update to fix the damage done by the July update!

Installing the Cumulative Update – and Waiting

First, a warning passed on to me by the MS Support engineer who handled our original incident: after you connect to each of your Lync Front End servers and before you install this update, make sure that Event Viewer and Performance Monitor are not open. To be safe, close all MMC windows, including the “Server Manager” one that comes up by default when you log on to Windows Server 2008 or 2012. If you’ve read the release notes (which you should have!), you’d have seen this, but I’m stating it again, as the MS Support engineer thought it important enough to contact me directly.

Our installation of the update went smoothly, taking less than half an hour per server, including the time to stop all Lync services before and for them to start again after. We only had one server out at a time; the pool was still running.

Now, back to the whole “eventually” part. You will not see a “good” delta the first day you run an address book update, no matter how many times you enter “Update-CsAddressBook”. Continue reading