Allowed registry values
Any string value
Registry value type
When we sat down to put together the articles for use in this series, our goal was to try to figure out what pieces of Microsoft Lync you could manage by using the registry; to be honest, we weren't all that concerned about whether or not you might want to manage those pieces of Microsoft Lync in the first place. We'd show you what all you could do, then let you decide whether you had a good reason to do any of it.
Which brings us to this article. As it turns out, Microsoft Lync stores the last phone number that you dialed in the registry; as it also turns out, you can easily use a script to retrieve that phone number. Is there any reason why you'd want to use a script to retrieve the last phone number you dialed? Well, like we said, that's entirely up to you.
But if you do have a good reason for retrieving the last phone number dialed, here's a Windows PowerShell script that does just that: it retrieves the value of the HKCU\SOFTWARE\Microsoft\Communicator\LastDialedNumber registry value. If you'd prefer to retrieve this value from a remote computer, simply set the value of the variable $computer to the name of that remote computer. For example:
$computer = "atl-ws-001.litwareinc.com"
Here's the script we've been talking about:
$computer = "."
$registry = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey("CurrentUser", $computer)
$key = $registry.OpenSubKey("SOFTWARE\Microsoft\Communicator", $True)
Write-Host "Last Dialed Number:",($key.GetValue("LastDialedNumber",$null))