Trace cables the easy way with Cisco CDP on Windows

26. February 2010

No matter how good your network diagrams are, sometimes you need to verify the port your server/desktop is in. Cisco Discovery Protocol is a great tool for network admins when you need to quickly map routers and switches, and if you’ve got an ESX server connected you’ll see that it picks up CDP info too – but the vast majority of my managed systems are Windows.

Here’s how to use TCPDUMP by Micro Olap to extend that functionality to your Windows boxes.

Firstly you need to find the interface number of the network adaptor you are trying to find CDP data for.  Use this command:

tcpdump -D

Which gives you a list of the interfaces on the computer:

clip_image002

My actual NIC is the third one in the list, so I can run the command:

tcpdump -i 3 -nn -v -s 1500 -c 1 ether[20:2] == 0x2000

-i n [interface and the number in the list, for me 3]

-nn [don’t resolve DNS, speeds things up]

-v [verbose mode, otherwise we won’t see all the packet details]

-s 1500 [set the maximum packet size to capture, the MTU is 1500 by default so it will capture the entire packet]

-c 1  [Capture one packet only, since we only want the CDP packet and filter using the header]

ether[20:2] == 0x2000 [Check the Ethernet header packet ID for the hex value 0x2000 – CDP protocol]

image

Some output is omitted, but you can see that the name of the switch and the port are both in there.

Easier than tracing a cable!

Cisco, Networking, Windows 7, Windows Server, Windows XP, Windows Vista, Windows Vista SP1 , , , , , ,

How to force the removal of Folder Redirection from specific user accounts

3. April 2009

We have a folder redirection policy in place for all of our users in combination with a roaming profile policy - this policy is applied to the OU that contains our users. Unfortunately this policy was accidently linked to the root of our domain too, causing our Domain Admin users to be redirected too - something we do not want. When the mistake was discovered, the policy was unlinked, but the redirection remained (despite being set to revert when users fall out of scope). I tried re-applying the policy, modifying the out of scope policy and then moving the Domain Admin user out of scope, but it failed to remove the folder redirection.

In the end, the solution was straight forward enough:

Create a new OU (I used "Temp") and move the affected user(s) there:

image

Create and link a new Group Policy Object to the new OU. Name it something descriptive so you know what it is in future - Folder Redirection Removal.

image

Edit the group policy, drill down to User Configuration > Windows Settings > Folder Redirection and right click - properties on each folder you want to reset. Set the setting to “Basic – Redirect everyone’s folder to the same location” and set the target folder location to “Redirect to the local userprofile location”.

image

Select the settings tab and make sure the Policy Removal setting is set to “Redirect the folder back to the local userprofile location when the policy is removed.”

image

Set that for each folder you want to reset. Close the Group Policy Object Editor, and GPMC. Log onto the user's account on each computer you want to remove the redirection on - in my case, several servers. Check the location of the redirected folders to make sure it’s been removed. Once you’re sure, you can move your user back to the correct OU.

Active Directory, User Profiles, Windows Server 2003, Windows Vista, Windows XP , , , , , , ,

Dell Latitude E6500 blue screen of death on XP install/downgrade/reinstall

7. January 2009

I've just had a frustrating few days trying to downgrade 4 Dell Latitude E6500 laptops to XP. The problem was, whenever you booted to the XP cd you would get to the point just before you agree to the license and then hit a blue screen with a SATA error code. It seems that the bundled driver for the SATA storage controller incorrectly identifies it and causes a fatal error as it's loaded.

 The solution is fairly specific and needs to be done exactly in the order prescribed below. You will need a USB floppy drive, and a blank floppy disk.

  •  Firstly, go to Dell's support website and select the downloads for your E6500 laptop (if you enter your service tag, you might find that there are no XP downloads available -use the product select instead).
  • Download the LATEST BIOS - at the point of writing that's A11.
  • Also download the Intel Matrix Storage Manager Driver.
  • Plug in your USB floppy, insert the disk and format it. Extract the storage manager driver, and then copy the extracted files onto the floppy. Unplug the floppy
  • Now run the BIOS update, follow the on-screen instructions, let it reboot and flash your BIOS.
  • Reboot, and on the BIOS screen, hit F2 to enter into the BIOS setup.
  • Move down to System Configuration, then SATA operation. Make sure it's set to IRRT.
  • Move through the BIOS and disable Parallel, Serial, and any other devices that aren't needed. Switch the NIC to Disabled. Also go down to Miscellaneous Devices and ensure USB and the Modular bay (i.e. CD/DVD) are enabled. Disable everything else.
  • Plug in your USB floppy, and insert the floppy containing the drivers from earlier. Also put your Windows XP install CD in the CD/DVD drive. Save your BIOS changes and then reboot.
  • On the BIOS screen, hit F12 to bring up the one time boot menu. Select your CD/DVD ROM device.
  • *IMPORTANT* The blue windows installer screen will come up and you have a few seconds to hit F6 to specify that you want to use a 3rd party driver for storage.
  • Once you've hit it, wait for the next screen, which will be asking for your driver. Hit S and specify the Intel SATA driver needed. There were 4 drivers in the list for my laptops, trial and error will find the right one. It should say that Windows already has a driver for that device - do you want to use the new one? Well of course you do, the old one blue screens. Hit S to accept it and at the next screen, hit ENTER to continue.
  • After that, it's plain sailing - just don't forget to enable all of your devices once you've installed XP!!!

Windows XP

Create a 100Mb file for testing transfer speeds

18. July 2008

We have a Bonded ADSL solution for our servers to provide the necessary upstream transfer speeds for the applications we host. We have bonded ADSL because our exchange still doesn't support SDSL, and a leased line is overkill. Theoretically, we should have 28.1 Mbps download and 3.2Mbps upload - what I am actually seeing is about 1.7Mbps down and 1.9Mbps up. I have tested this on various servers, over various times and file sizes, there is no doubt that the performance is POOR.

Anyway, on to my point. I wanted to create a file that was exactly 100MB to test transfer speeds. Windows XP, Vista, 2003 and 2008 all have a command line utility called FSUTIL.exe which has a subset of commands to manipulate files, with which you can create a file that is exactly 100MB...like so:

FSUTIL FILE CREATENEW 100MBTest.mdb 1048576

Usage: FSUTIL FILE CREATENEW [Filename] [Size in bytes]

 Nice!

Windows Vista, Windows XP, Exchange , , , , , ,

Fixing your Windows Vista MBR

30. May 2007

I recently installed Vista as a dual boot with my old XP installation, while I transferred things over and made sure I could do all I need to do with my new Vista install. It came to the point when I needed to remove XP and solely rely on Vista. Some might say that’s brave, others foolish, others still insane. Whatever your opinion, I needed the HD space and was having no problems with Vista, so I bit the bullet.

Dusting off Partition Magic I set it to remove the old XP partition, resize the new Vista partition, make sure the Vista partition was a Primary partition rather than a logical one, and then reboot into Vista.

The outcome of this is that I wrecked my boot. XP is gone. Vista is there and readable, but there is no boot. All this signalled a problem with the MBR (master boot record). No problem in XP, it’s a simple boot into the Recovery Console and a fixboot or fixmbr. Foolishly I expected the same simplicity for my Vista install. No. Niet. Nein. Non.

 After some serious digging I found this KB article 919529 which outlined the use of Bootsect.exe and BCDEdit.exe to restore your MBR after you’ve installed an older version of Windows. At least it showed me where the tools I needed are!

  1. Boot from your Vista DVD and click the Repair option. It’ll search for Vista installs and then give you an option of which one to repair. Try the automatic boot repair first, because you can really screw up your hard disk if you don’t know what you’re doing. If that doesn’t work, it’s likely that your MBR is bad or missing.
  2. Fire up the Command Prompt from the Repair screen.
  3. Try running “Bootrec /RebuildBcd
  4. I used Bootsect.exe to repair the Vista boot loader. Note that this tool is not on your Vista installation, but on your Vista DVD. To repair your MBR and restore the Vista Bootloader, use the following command: “d:\Boot\bootsect.exe /NT60 All
  5. Now you need to check that your bootmgr (think Boot.ini) has the correct entry in it for your OS(s). BCDEdit is located on your Vista install, so navigate there - mine is on my C drive. I used the following command to view it: “c:\Windows\System32\BCDEdit.exe /enum all /v
  6. For me, there were no issues with my Boot.ini, so I didn’t have to edit, delete or create any entries. This might not be the case for you, for help using BCDEdit, use BCDEdit.exe /? for the help menu

 Other reference:

http://technet2.microsoft.com/WindowsVista/en/library/08d64d13-4f45-4a05-bd86-c99211a93dd91033.mspx?mfr=true

http://support.microsoft.com/kb/927391

Windows Vista, Windows XP , , ,