List Open UDP Ports Using Powershell

In the last post I showed how to list open TCP ports using Powershell. Unlike the netstat command in DOS, Powershell splits TCP and UDP into two different commands, Get-NetTCPConnection and Get-NetUDPEndpoint. Here are some examples of Get-NetUDPEndpoint.

Get-NetUDPEndpoint by itself will return the local address and local port

Get-NetUDPEndpoint

To show listening ports filter for the address 0.0.0.0

Get-NetUDPEndpoint | Where {$_.LocalAddress -eq "0.0.0.0"}

To view the owning process ID, add the OwningProcess field.

Get-NetUDPEndpoint | Where {$_.LocalAddress -eq "0.0.0.0"} | select LocalAddress,LocalPort,OwningProcess

And use this command to display the name of the owning process.

Get-NetUDPEndpoint | Where {$_.LocalAddress -eq "0.0.0.0"} | select LocalAddress,LocalPort,@{Name="Process";Expression={(Get-Process -Id $_.OwningProcess).ProcessName}}

In my next post I will demonstrate combining Get-NetTCPConnection and Get-NetUDPEndpoint into a single command.

List Open Ports Using Powershell

In a previous post I showed how to use the netstat command to show open ports. This is another way using Powershell which gives you more options.

Get-NetTCPConnection is the Powershell equivalent to netstat and by itself will return a similar output to netstat.

Get-NetTCPConnection

To show only the listening ports we need to filter for all items in the Listen state with the remote address of 0.0.0.0

get-nettcpconnection | where {($_.State -eq "Listen") -and ($_.RemoteAddress -eq "0.0.0.0")}

You can add additional fields like the process ID for each port. Changing the fields from the default requires selecting each one you want and then piping to ft (format-table).

get-nettcpconnection | where {($_.State -eq "Listen") -and ($_.RemoteAddress -eq "0.0.0.0")} | Select LocalAddress,LocalPort,RemoteAddress,RemotePort,State,OwningProcess | ft

This example will get the name of the process associated with each item.

 get-nettcpconnection | where {($_.State -eq "Listen") -and ($_.RemoteAddress -eq "0.0.0.0")} | select LocalAddress,LocalPort,RemoteAddress,RemotePort,State,@{Name="Process";Expression={(Get-Process -Id $_.OwningProcess).ProcessName}} | ft 
OpenDNS

OpenDNS Web Filtering: Your Choice, Not Your Government’s

OpenDNS recently published a new policy officially stating that they “will not allow governments or ISPs to use our services to dictate which websites are accessible at a national or regional level”

They also say that they have held this belief since they launched in 2006 but are not making it an official policy.

I think this is great that they are taking this stance and supporting anti-censorship, but, since they are a US based company, I wonder what will happen if/when the US government decides to start blocking sites.

I still think OpenDNS is a good service and I recommend checking them out if you haven’t already.

Upgrading Through Every Version of Windows

windows 1.01

Here is an interesting video showing that it is possible to upgrade through every major version of windows. The author started by installing MSDOS 5.00 and windows 1.01 on a virtual machine and proceeded to repeatedly upgrade until he reached windows 7.

It is unclear if the virtual hardware was upgraded during the process. I would be surprised if he got windows 1.01 running on newer hardware, or windows 7 running on old hardware.

Quick Tip When Installing a UPS

Here is a quick tip I have learned after installing and replacing many UPSs (aka. Uninterruptable power supply, aka. Battery Backup). Most of the time, a desktop UPS will have two rows or sections of outlets. One for battery backup and one that is just for surge protection, so it works like a power strip too. This is convenient since you can plug in a lamp or printer or something else that doesn’t need backup power without running an extra power strip.

The bad thing about this is that sometimes people will plug things in to the backup side, not knowing the difference and this significantly shortens the time the battery will last during a power outage. I’ve even had people plug in space heaters on the battery side which overloads the circuitry and ends up killing power to their computer and everything else plugged in. So, here is a little trick I’ve started doing to prevent this.

UPS_WarningI’ve been buying the APC BE750G for all the desktop computers, which is a pretty good UPS, over all. One of it’s features is the master / slave outlets so you can have it shut off items plugged in to some ports when you turn your computer off. But, the trick I’m talking about involves the warning sticker they come with covering the backup outlets. The sticker is to warn you to turn it over and connect the battery before you use the backup outlets. Normally you would just connect the battery, then peal the sticker off and throw it away. I just pull back enough to uncover the one or two outlets I need, cut off the excess and leave it in place to cover the other backup outlets. My thinking is that if someone is looking for an outlet they will see the big yellow warning sticker and leave it alone without bothering to read what it actually says. At the very least, it makes it inconvenient to peal it off.

So far, this has kept everyone from plugging things in to the backup outlets, but hasn’t kept them from tripping breakers with the space heaters under their desks. UPS_Warning_Sticker

The Many Uses of Dropbox

dropbox_logo

Dropbox is a service that allows you to synchronize folders and files between two or more computers. Dropbox also store a copy of the folders and files in the cloud on their servers so you can access them from a friends computer that doesn’t have the service installed. They offer a free account with a 2gb size limit and paid accounts if you need more storage.

On the surface, this sounds like a simple, straightforward service, and it is. Dropbox is very easy to set up and use and can quickly make itself an indispensable part of your every day computing. But, once you’re able to automatically sync files between your computers, this opens up many possibilities you may never have thought of.

Here are some of the things that I’ve found very useful about Dropbox.

Moving files from one computer to another. This is one of the obvious uses, but it’s very nice to not need to worry about burning CDs or copying files to a thumb drive just to get a file from one computer to another. You also don’t have to mess with things like network file sharing and firewall settings.

A subset of the previous example is that it’s easy to move files from a PC to a Mac or to a Linux computer without worrying about things like drive format or file systems since Dropbox works on all three platforms.

Keeping a working copies synced up. You can save a document you’re working on in a dropbox folder and be able to work on it from any computer and always know you’re working on the current version. Dropbox will also keep previous versions of documents so you can go back in time if needed.

Automatically starting a torrent download. This is handy for any kind of program that can watch a folder for new files then perform some action on them.Portable_Apps

Portable apps. Keep your portable apps stored in your Dropbox instead of a thumb drive. This will also keep the settings synced between computers.

Making large files available to others. When you need to send someone a file that’s too big for email, Dropbox has a feature that lets you share a file or folder with a friend just by sending them a special link. They only get access to the files you specify and not everything in your dropbox.

Online storage as a backup for when you’re at another computer. As stated in the introduction, your files are not only synced between your computers, but an extra copy is stored on their servers in the cloud. This is handy as a backup, or just when you need to access your files from a friend’s computer.

Getting files onto your phone and portable devices. Dropbox apps are available for smartphones like the iPhone and Android phones and portable devices like the iPad.  You can also get documents , PDFs and ebooks onto your iPad using an app like Goodreader.

Store Passwords. You can store your passwords in a program like KeePass to always have your passwords available. KeePass keeps your passwords stored in an encrypted file so there is no worry about anyone getting access to them. You just need to remember one master password and it keeps track of the rest. I used this method for a long time, but have since moved to LastPass which stores passwords in the cloud and integrates with your browser.

Keep your to-do list synced with outlining applications like Noteliner.

There are a lot more uses for Dropbox that I haven’t mentioned here. You can search online and fine several, but I suggest you just start using it and see how it fits in with the way you use your computer.

You can sign up for a free 2gb account to get you started. If you use this link, it will help us both by giving each of us an extra 250mb of space. If you refer your friends and family, you can an extra 250mb for each of them.

Update:

Lately I have started using Windows Live Sync (now called Windows Live Mesh) for the same purposes listed above. The difference was that Windows live sync allows you to synchronize an unlimited amount of files and didn’t have the size limit of Dropbox. The downside is that Windows live sync didn’t offer any online storage but I didn’t really need it for what I use. Since the recent changeover to Windows live mesh they offer 5gb of online storage and a few other features like remote desktop. I admit that I like Dropbox better since it seems to work better and is a little more user friendly, but you should check out live mesh too.

CCleaner Updates to Version 3.0

Ccleaner 3.0CCleaner is a program I use all the time as part of my regular maintenance routine for the workstations I support. It works by cleaning up old program data and checking for and correcting misconfigured registry settings. When I get complaints about a workstation running slow, in addition to CCleaner, I also:

  • Run a defrag (see my article on automating the defrag)
  • Run scandisk
  • Check for old or unapproved programs to uninstall
  • Check for old security settings or other configurations
  • Update Windows, Office, drivers, and any other programs that need it
  • And, finally, run CCleaner

Piriform just released a new version of CCleaner. Some of the more notable updates include native 64-bit support, a new drive wiper tool, support for newer browsers and web standards, as well as various other cosmetic changes.

Check out the Piriform blog for more information on the update and to download a free copy.

Let me know in the comments what programs you like to use for PC maintenance or if you’ve given the new version of CCleaner a try.

Technical Book Club

Practice of System and Network AdministrationI’ve started listening to the Mind of Root podcast again, and just in time. They are starting a book club, but not the kind of book club you would expect. Instead of the mainstream fiction or self-help books you see in most book clubs, they are covering technical books for system administrators.

The first book they are going to be going through is The Practice of System and Network Administration. It looks like a very interesting book and I can’t wait to start going through it. They describe it as a “non-technical” technical book because it talks about general concepts and procedures instead of specifics that may change with each software upgrade.

Here are some of the more interesting chapter titles:

-What to do when… (How to handle various situations)

-Climb out of the hole (Managing your backlog of tasks)

-Workstations

-Servers

-Services

I think this book is going to be very useful for me since I’m the only IT person where I work and sometimes that makes it hard to keep up on new administration procedures.

They are going to be discussing it chapter by chapter on their blog, so head over to the Mind of Root blog and check out the discussions.

Let me know in the comments below if you have any similar book recommendations.

Windows ReadyBoost in a Laptop

Laptop ReadyBoostHave you ever wanted to speed up the performance of your laptop using Windows ReadyBoost but didn’t want to constantly be plugging and unplugging a USB flash drive? Here is a solution that’s small enough to leave in your laptop all the time. It’s a combination of a microSD flash memory card and a tiny USB microSD card reader.

Windows ReadyBoost is a technology that was first introduced with Windows Vista then continued in Windows 7. It helps speed up your computer by allowing windows to use it for swap space as well as optimizing system and application startup files on it so they load more quickly. This works better than a hard drive alone because startup and swapping usually involves accessing many small files and flash memory exceeds over hard drives at its random access speed. This also works with your hard drive so that two data stores are being access at the same time to help eliminate bottlenecks and queuing. It is also safe since it is only keeping a copy of the files which are still stored on your hard drive. This means you won’t lose any data or cause any harm to your computer if for some reason it fails or isn’t there when you boot up.

My friend showed me this microSD card reader which was small enough to carry on his keychain and not get in the way. I notice how small it was after the cover was removed, then had the idea of using it as a permanent ReadyBoost drive for my laptop. The key component is an elago Mobile Nano II USB microSD Card Reader.  You also need a microSD or microSDHC card that’s fast enough to use with ReadyBoost. The faster, the better. I’m using this Transcend 8gb Class 6 MicroSDHC card.

Laptop ReadyBoost card and reader

Here is the card reader without the cover. See how small it is?

Laptop ReadyBoost reader without cover

The microSD card sticks in the front of the reader in a slot under the USB connector.

Laptop ReadyBoost card in reader

Here is the card in the reader. You can hardly tell it’s there.

Laptop ReadyBoost

Now, just put it in one of your laptop’s USB ports…

ReadyBoost in laptop

…and set up ReadyBoost.

Laptop ReadyBoost settings

I put it in the side since it gets in the way of the docking station if I use one of the ports on the back. Even so, you can barely even notice it’s there and it never gets in the way.

ReadyBoost in laptop

Microsoft recommends a readyboost drive about twice the size of the physical memory you have. Since I have two gigs of memory in this laptop, I only used about half of this 8gb flash drive leaving 4gb free. You can use this extra space as extra storage, or do what I did.

Stay tuned to an upcoming post about how I used the extra space as a:

Multi-Boot Linux USB Boot Drive

Subscribe to the RSS feed or mailing list to be notified as soon as it’s available.

USB Linux Multiboot

Questions or comments? let me know if this worked for you or if you have a different solution in the comments below.