Tenaci.us

Tenacious - Of or having tenacity. Persistent.

Scripts (mostly PowerShell) and other utilities I've written for fun and administerial laziness.

RDP Shadow Session

Microsoft's RDP client (mstsc.exe) includes a very powerful and useful feature for admins needing to connect to a remote PC/Server and connect to a session that is already logged in. This over-the-shoulder view and control is very helpful when rendering aid to someone without having to resort to them simply describing the problem and hoping your imagination can fill in the gaps. You can see it for yourself. This feature is built in and quite useful as-is. However, there are two points of contention I have found when using this feature in the real world and this script is meant to address both of them.

First, in my environment, RDP shadowing is governed by Group Policy and is configured to present a pop-up box that presents the user with the option to accept the shadow session or reject it. This is not usually a problem, but I am lazy and having to inform the user to expect the box and dealing with the confusion from trying to translate what I'm telling them to what they are seeing on their screen is occasionally cumbersome so this script auto-accepts the dialog for them when it pops up.

Second, when the shadow session is over, it is usually clear from the conversation you're having with the user, that the session is complete and they can resume their work normally, however, there is no indication on-screen that the session has ended and some users don't feel comfortable resuming their work wondering if someone is still looking over their shoulder - to the point of sometimes calling me back to ask if I'm still shadowing their session. To resolve this problem, this script presents a transparent overlay on the screen (in the upper right-hand corner) and when the session is disconnected, the overlay is removed - giving the user visual feedback that the session has ended.

For the complete write-up go here: RDP Shadow Session

Cisco Phone Directory Lookup

The Cisco Call Manager or Unified Communication Manager provides directory services for the telephone extensions it manages. Most Cisco VOIP phones provide a utility for searching the directory by name or number. It is a good utility to include on the phones, but it is a bit cumbersome to use - entering alphabetic characters from a numeric keypad.

This script provides the ability to query the directory from your PC using your keyboard to enter the search parameters.

For the complete write-up go here: Cisco Phone Directory Lookup

Remotely Get CDP Neighbor

Most Cisco network gear will send a multicast advertisement every 60 seconds to each port with port information useful in identifying which specific port the device is plugged into. This can be very helpful when troubleshooting network issues or locating the physical device when all you have is the hostname.

A PowerShell module written by lahell here does a very good job. My script adds one additional feature - if it discovers that the computer is connected to a Cisco VOIP phone, it will then query the phone for its CDP neighbor and display the port information for both the computer and the phone.

For the complete write-up go here: Remotely Get CDP Neighbor

Remote ScreenShot

Sometimes you just need to see the screen. It is inevitable. You quickly threw together a remote install script to patch a bug on a specific PC, and you tested it extensively on a test machine, but the production machine has a high-profile user on it and you've been instructed not to interrupt the user, but to get the patch installed. Confident from your testing, you launch the script and it never finishes. Hmmm, what stalled the process? Is there a dialog box needing user interaction that somehow popped up on the prod box that didn't on the test machine? Did you BSOD the prod box and an uproar is on the horizon. You REALLY need to see that screen. Enter RemoteShot.ps1...

For the complete write-up go here: Remote ScreenShot

Scan Subnet for Open TCP Port

Almost every admin needs nmap occasionally for a variety of thinks. It is a very powerful, well-conceived, and well executed utility that has amazing options and provides for endless learning and discovery opportunities. There are occasions, however, where you are on a PC that does not have nmap installed and for any number of reasons can't have it installed and you still need to do a basic TCP port scan of a subnet looking for devices that have a common port open on them. This script provides that functionality. It was originally written to help locating PCs on a network for inventory purposes. It then quickly (and briefly) was altered to locate printers. It was very apparent that with just a few very minor adjustments it could scan a subnet looking for any TCP port. Along the journey improvements were made for speed and efficiency and this version is the current state. Please forgive the name of the script - some of the major rewrites are reflected in the name to help me differentiate between the various iterations. if you use it, name whatever you want. :)

For the complete write-up go here: Scan Subnet for Open TCP Port





My favorite Microsoft error.
Learn more