Test-NetConnection: Use Powershell to Check Port Connectivity

For the longest time, I’ve used a combination of PING, TRACERT, and TELNET to do basic network connectivity testing and troubleshooting. However, telnet is not installed by default, which can present a problem while doing on the fly testing on machines.

Enter Test-NetConnection.

Introduced with Windows 8, Test-NetConnection is a Powershell command that can handle most of the features of the above command line tools. This cmdlet is not supported on Windows 7, but I’m sure that all of you have upgraded by now. Right? šŸ™‚

In it’s most basic functionality, it can ping a host.

TEST-NETCONNECTION GOOGLE.COM

It can also check to see if a port is open on the site:

TEST-NETCONNECTION GOOGLE.COM -PORT 443


So, what if the port is closed? You’ll get this, complete with whether or not the host is even pingable

TEST-NETCONNECTION GOOGLE.COM -PORT 445

You may be wondering, what are all those other IP’s that it tried? Fortunately, they have a detailed command that we can run. By adding the informationlevel command, we will get more diagnostic information that can be useful.

TEST-NETCONNECTION GOOGLE.COM -INFORMATIONLEVEL DETAILED


As you can see, it lists all of the different IP’s that resolve to that hostname. It will then check each of those when checking whether or not a port is open. Needless to say, this can be very helpful when trying to sort out erratic issues.

You can also see the next hop that it took to get to the site. That will normally be your default gateway, so it can provide an added level of detail when troubleshooting.

I mentioned that this tool can also do some traceroute commands as well. Let’s take a look at that in action. Just add -TRACEROUTE and you’re in business.

TEST-NETCONNECTION 10.42.196.3 -TRACEROUTE

There you go, you can see the hops taken to get to the destination. You’ll note that this doesn’t show as much information as a traditional traceroute, however it gives enough detail to handle the basics.

While it is a bit more complicated, if you run as an admin, you can use the -diagnoserouting -informationlevel detailed switches, and get far, far more information. That’s a bit beyond the scope of this writing however.

Hopefully this has been helpful to you! I am gradually shifting over to this as my go-to basic networking troubleshooting tool, and it is making quite a difference.

What Sort of Things are Found in One’s Facebook Archive?

With all the press about Cambridge Analytica and Facebook and the amount of data that is being captured, I figured I’d take a look into what was captured of mine. I know that there are some other, similar articles that have been done on this topic, but I was curious what I’d find since I disable some of the default data settings.

So here go! My archive came in at 5.25 GB. I started using Facebook back in the beginning of 2007, so that’s a little more than 11 years of data.

After extracting, and opening up the index file, I’m greeted with my profile information. On there they have every book I’ve ever read on Goodreads (makes sense, since I share the login), my phone numbers, previous email addresses, the things I like, and all relationships. Including my one-day april fool’s day relationship, whoops! One bit that stood out was that it listed what movies I’ve seen. It’s a very short list, so I’m thinking that it’s stuff that it has parsed from checkins.

Next down on the Index is “Contact Info”. I had thought that that would be all my contact info, but it turns out that that is my PHONE’S contact list. There’s a lot of names on here that I would only have had on my cell phone, so I guess there was a sync at some point? The other surprise here is that it seems to have captured EVERY number associated with them. So for my friends who constantly changed numbers (you know who you are!), there’s 10 different numbers linked.

The link after that takes me to timeline. This is a 25 MB HTML file that took a few minutes to fully load up. Probably due to it listing out every single Facebook activity taken. This includes every song I’ve played on Spotify since the mid 2012, every status update, every wall post, and so on. Interestingly, it’s just text. No images are included. Neither are any comments or liked. However, stuff other people posted on my wall is there. Go figure.

Following that we’ve got “Photos”. This has every album I’ve ever posted, including “wall photos”. These include comments, but no likes. It also includes limited metadata on the photos. No major surprises here, though one could count the raw face recognition data of me as being somewhat interesting.

Next up we’ve got videos. Same as the photos, just with videos. I have posted very few videos on Facebook. Per this, my last one was 2014. There are videos back to 2009. So far, it seems like everything is retained forever on Facebook.

Going down the list, the next one is “Friends”. This is a ordered list of all my current facebook friends and when we became friends. Further down there are friends that I’ve requested (but they never accepted), friends that have requested me (that I’ve ignored), friends that I rejected, and friends that I’ve removed (and the dates I removed them). So that’s interesting from a historical perspective.

We then have “Messages”, and wow, do they ever! Looks like every message that I’ve ever sent or received. Some interesting things here though. First, message threads that I’ve deleted are not here. Secondly, friends who have deleted their account show up as “Facebook User” with no name attached. Most shared images are included, but not all. For me, it seems like anything older than 2015/2016 are just blank. Just to check if something was missed, I scrolled back through old conversations on Facebook itself, and they weren’t there either. Go figure. But all the text is there (and the stickers!)

Oddly, there is an entire section for “Pokes”, which has the current friends who have poked me and the streaks. Kinda pointless in my opinion, but hey, gotta love completeness.

After that, we’ve got “Events”. It’s a list of every event I’ve been invited to on Facebook, going back to 2008, complete with my response. For me, mainly ignored or declined.

The Security page is interesting. It’s a list of programs that have access to my Facebook, ranging from phones, phone applications, Spotify, and so on. It also has changes to account, like changes to passwords, security settings, and profile pictures. These seem to go back to day one.

There’s then a page for “Ads”. This has all the ad topics that Facebook thinks I’m interesting in. Some definite oddities though. There’s a city where a friend of mine lives that I’ve never been to, some movie genres I’ve never cared for, and a couple bands that annoy me. Go figure. There’s also a a list of “Advertisers with your contact info”. Nice having that info, but a little alarming.

Next to last, we’ve got “Places Created”. I’ve got 2 places that I created on Facebook back in 2010. Nothing really interesting here.

Finally, we’ve got applications. This is just a list of the applications that I’ve got installed on Facebook. No surprises here.

So, there’s a lot of stuff here. I don’t see some of the stuff that I’ve seen reported elsewhere. I’m guessing this is due to my more selective security settings. I’ll probably tighten my settings a little bit more. Honestly, a little disappointed that some of my older Messaging images are gone, but oh well.

 

 

 

Disable SMB1

In light of the recent details of SMBv1 being incredibly vulnerableĀ  to attacks, it’d be a good idea to make sure that SMBv1 is disabled on your systems. There isn’t much reason to leave it enabled, it was deprecated in Windows Vista/Server 2k8, and unless you have an old NAS that requires SMBv1, you should be able to disable it without any harm.

The other benefit of disabling SMBv1, is that it forces your systems to use SMBv2 or v3, which perform better.

So, let’s go through how to disable it quickly and easily.

For Windows 8.1 and above, as well as Windows Server 2012 R2 and above, it’s just a simple PowerShell command.

To run Powershell as an Admin, please do the following:

  1. Click on Start
  2. Type in “Powershell” without the quotes
  3. Right click on “Powershell” and click run as administrator. Do not run Powershell ISE
  4. Click on “Allow” if a prompt comes up

Server2k12R2+

Open a PowerShell window as Admin

Remove-WindowsFeature FS-SMB1

If all goes well, you’ll get a message saying it was successful.

Win8.1+

Open a PowerShell window as Admin

Disable-WindowsOptionalFeature -Online -FeatureName smb1protocol

You’ll get a message saying that it has succeeded.

For the remaining versions of Windows, the commands are a little different.

Win8/Server2k12

Open PowerShell window as Admin

Set-SmbServerConfiguration -EnableSMB1Protocol $false

Windows Vista/7/Server 2k8/2k8R2

Open PowerShell window as Admin

Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters" SMB1 -Type DWORD -Value 0 -Force

Then restart the computer

Disabling SMBv1 is simple, quick, and highly important both from a security standpoint and a performance standpoint.

Multi-system Lightroom

I’ve been doing photography for years. And, for years, I’ve been using Adobe Lightroom to manage and edit my photos. With the advent of the photographer’s plan and the two-system allowance, I’ve been able to get Photoshop as well, for a low monthly cost.

However, one feature that’s always been missing is catalog sync between systems. While some people will throw the catalog on a network share, and use it from there, I’ve never been comfortable with doing that due to corruption concerns.

Historically, I’ve just used RDP from my tablet or laptop to get to my desktop where I have Lightroom installed. There are some disadvantages to this method. For starters, if my connection dips for any reason, or if RDP decides to throttle my connection, I’ll end up with artifacts as well as a reduced color depth. It also, even at its best, feels less responsive. And, with Lightroom not being the fastest program, these negatives effects are compounded by RDP.

This solution was a two-part solution. First part was to get my 1 TB of photos to a faster, more central location than my desktop hard drive. I have a homeserver with a large RAID10 array. Thanks to dual NICs, I’ve got the network bandwidth to spare, and RAID10 is quite a bit faster than my local hard drive. RAID also lets me lose a drive without having total downtime until I can replace a drive and restore from Crashplan.

So, I fired up Lightroom, and added the share for the drive to my folder list. I then moved a few folders over for testing from my desktop. I decided that if the speed was similar between desktop and server, that there would be no harm in just moving everything before trying the sync. After doing a few tests, I couldn’t really see a difference so I started moving the rest of the photos. I did the photo moving from Lightroom so it’d keep all the data, rather than moving in Explorer and reimporting. It took a little longer, but I feel that it was worth it.

It was at this point that I remembered that I had photos in a second location. Since Lightroom is so sluggish, I have a secondary SSD where I keep photos that I’m actively working on. When I’m done with them, I move them back to the main photo location for storage. I didn’t want to lose access to these photos when I’m working on my laptop, so I set up some mapped network drives to keep everything straight. Luckily, I don’t have drive letter mixing between my laptop and desktop, so it was a quick fix.

Finally, it was time to set up the sync. I used allwaysync, since I wanted to capture the previews as well, and it seems to handle massive syncs better than some of the other tools I’ve used. Once I set it up to sync my lightroom folder to my laptop, and it finished running (It took forever due to there being over 100k small files), it was time to test.

I opened the catalog on my laptop, and all my previews, presets, and filters were right there. To test, I did some edits and browsed through some folders. Even with DNG/CR2 files, there wasn’t any extra lag as compared to running from my desktop. I’m doing this testing on an Asus Ultrabook (16gb ram/I7) running on AC wifi.

All in all, I’m quite satisfied with the performance, and I think that this will make photo editing a lot more mobile. For example, if I’m traveling, all I need to do is move a folder to my laptop via lightroom, and sync up when I get back. Or, I can import some files to my laptop while on a shoot to do in the field edits, and then sync back when I’m home.