Archive

Archive for January, 2018

One Liner: Getting Your Public IP Address With PowerShell

January 12th, 2018 1 comment

My friend Matt (@MatthewDippel) was espousing the clean results that https://wtfismyip.com provides over more popular sites like http://www.whatismyip.com. Matt noted that other than the explicit language on wtfismyip.com, the results were cleaners and easier to use that others. Matt’s a developer, so I had to give him some grief that he used a web page instead of writing some code. I figured I should share that code here, because in ten minutes, I’ll forget what it was, and need to look it up some time in the future.  🙂

The information is fairly straight forward to retrieve, assuming you can find a source that provides it. dnsomatic.com is one such site. If you see the documentation for developers at http://www.dnsomatic.com/wiki/api, you can see that they provide an example of browsing to http://myip.dnsomatic.com returns the public IP of the client requesting the page. That being the case, we can use something simple like invoking a web request in PowerShell to get that data. Easy peasy. We can just look at the content value of the returned results:

(Invoke-WebRequest 'http://myip.dnsomatic.com').Content

And we see that it returns just a simple text value of our public IP address:

VERBOSE: GET http://myip.dnsomatic.com/ with 0-byte payload
VERBOSE: received 13-byte response of content type text/html
173.10.47.133

Now, we can expand on that a bit, albeit getting away from the one-liner concept. We can take the results of the above query and send them to the GEO IP service at webservicex.net and get some geo info:

$ip = (Invoke-WebRequest "http://myip.dnsomatic.com").Content
$geoip = New-WebServiceProxy "http://www.webservicex.net/geoipservice.asmx?WSDL"
$geoip.GetGeoIP($ip)

For more info on WebserviceX’s geo lookup, check out http://www.webservicex.net/New/Home/ServiceDetail/64.They’ve got some other cool solutions, including retrieving weather data, at http://www.webservicex.net/new/Home/Index.

And what we see here is

VERBOSE: GET http://myip.dnsomatic.com/ with 0-byte payload
VERBOSE: received 13-byte response of content type text/html
ReturnCode        : 1
IP                : 173.10.47.133
ReturnCodeDetails : Success
CountryName       : United States
CountryCode       : USA

We see where we get the country name and code as well.

BTW – I found another source of IP info that also doesn’t require cleanup. And that is Matt’s new favorite, wtfismyip.com.

(Invoke-WebRequest 'https://wtfismyip.com/text').Content

I’m happy to add others to this list if you send me the info.

You’ll notice the verbose output in the above examples. If you want to suppress the verbose output, we can do that with the -Verbose parameter, setting it to $false:

(Invoke-WebRequest 'https://wtfismyip.com/text' -Verbose:$false).Content

As you can see, getting your public IP address is fairly straightforward.

The Case of the Missing Skype for Business Presence Options in the Taskbar

January 8th, 2018 1 comment

On Twitter, Noah Sparks (@noahsparks) asked about why some users running Windows 10 can change their Skype for Business presence from buttons that appear when hovering over the Skype for Business taskbar, and others couldn’t. See these two examples taken from my Windows 10 Insider Preview machine.

Hovering over Skype for Business taskbar – no presence controls

Hovering over Skype for Business taskbar – with presence controls

Several people started to hypothesize about the difference, and looking at bitness (32 or 64bit), client source (Click to Run or MSI), and version numbers. Turns out it’s based on the value of a interestingly named registry key called AutoOpenMainWindowWhenStartup. Alexander Holmeset (@alexholmeset) posted the right key and value. I tested it and came up with the following PowerShell code to turn it on. The code basically makes sure you’re running the v16 version of Skype for Business, and then creates the key if it doesn’t exist, and sets the value. If the key does exist, it just sets it. Fire up PowerShell and paste the following. There should be no output.

if (Get-Item -Path 'HKCU:\Software\Microsoft\Office\16.0'){
  if (-Not(Get-ItemProperty -Path 'HKCU:\Software\Microsoft\Office\16.0\Lync' -Name 'AutoOpenMainWindowWhenStartup')){
    $null = New-ItemProperty -Path 'HKCU:\Software\Microsoft\Office\16.0\Lync' -Name 'AutoOpenMainWindowWhenStartup' -Value 1 -PropertyType DWORD
  }else{
    Set-ItemProperty -Path 'HKCU:\Software\Microsoft\Office\16.0\Lync' -Name 'AutoOpenMainWindowWhenStartup' -Value 1
  }
}

This code has only been tested on my machine, which is running the C2R version of the Skype for Business 2016 client. I noticed it only works when the taskbar icon is there, and doesn’t seem to work over the systray icon – but then again, there are already presence options when you click on the systray icon anyways. I haven’t tested with any other version of the Skype for Business client, nor on any other operating system. If you do test it with other platforms, please report your findings and I’ll update this post. To set it back (disable the presence options when hovering), just set the registry value to zero, such as shown below.

Set-ItemProperty -Path 'HKCU:\Software\Microsoft\Office\16.0\Lync' -Name 'AutoOpenMainWindowWhenStartup' -Value 0

Another mystery solved!

UC Inside Track: Episode 3: Huge Teams Features Release with special guest Matt Landis

January 5th, 2018 No comments

In this first episode of the new year, special guest Matt Landis and I discuss the whopper release of new features for Microsoft Teams, and how they relate to Skype for Business. They include:

New Calling Roadmap Features

  1. Simultaneous Ringing
  2. Speed dial
  3. Suggested Contacts
  4. Voicemail
  5. Translate user input to standard format phone number
  6. Call Quality Diagnostic Portal
  7. TTY Support
  8. Skype for Business-Teams Calling
  9. Blind Transfer
  10. Call Blocking
  11. Call Forwarding
  12. Caller ID masking
  13. e911 Support
  14. Extension Dialing
  15. Hold
  16. Multi-call Handling
  17. Enable Existing Calling Plan Support

New Meetings Roadmap Features

  1. Edge, Chrome Browser Support for meetings
  2. Interactive Troubleshooting
  3. Audio Conferencing in over 90 countries
  4. Mute Other Participants
  5. Application Sharing

New Messaging Roadmap Features

  1. Contact Groups
  2. Unified Presence

New IT Pro Roadmap Features

  1. Messaging Policies
  2. Teams Interop Policies
  3. Client Support

Delayed Features

  1. Enable Call Quality Analytics
  2. Lobby Support
  3. Anonymous Join
  4. Give and Take control in sharing

Episode 3: http://www.voss-solutions.com/media/podcast/podcast_003.mp3

UC Inside Track is available directly via the link above, via RSS, iTunes, TuneIn, Google Music Play, and Podcast Addict.