Archive

Archive for May, 2008

Export DHCP Reservations with Mac addresses:

May 26, 2008 Andrew Morgan 4 comments

I had difficulty recently with our DHCP reservations, namely i coudnt export the MAC addresses included in the reservation and the mmc was only allowing very limited as I could only export the ip address and the FQDN of the computer owner.

After a bit of rummaging i found an entry for DCHP in netsh. I found that you could dump the DHCP server settings to a text file. This included every server setting aswell as the reservations. I then filtered the exported file for “Add reservedip” using the find command to export a csv file with just the reservations.

Once i had the file in csv, i simply imported it into an excel sheet using spaces as the delimiter and hey presto a lovely little reservation report:

Same rules as always, dont run it from a UNC path, copy it local to the DHCP server and run it there.

netsh dhcp server dump >> reservationdump.txt
find “Add reservedip” reservationdump.txt >> reservations.csv

You can download the script as is here:

Deleting a user profile from multiple servers:

May 23, 2008 Andrew Morgan 2 comments

Ever needed to delete a users profile from 50+ servers? Ouch yes it happens, yes its annoying and yes it time consuming. I had a requirement to do this recently and i had to script it to save me logging into all 40+ Citrix servers and deleting the profile manually.

Now microsoft do have a tool called delprof and it is quite handy… but if you only want to delete one profile (not a whole rake of them) you are in trouble.

Step in the genius’s in ctrl alt del consultancy with remprof.exe. I’ve touched on this tool before, but today I’ve packaged a one stop batch file to delete a certain users profile from as many servers as you like!

The file relies on psexec, remprof and a text file containing the server names. if you are going to launch this from the network ensure you have the drive mapped. As with all my scripts it’s un-intrusive and wont leave you needing a restart.

The code can be found after the jump, if you dont care, you can find the script here:

Read more…

Expanding – To the dark side.

Well I’ve finally done what I’ve tried countless times, I’ve installed Linux on my Home PC.

Normally when i attempt this, i get as far as installing the operating system to the point that i get to the desktop… then i give up because the wireless drivers aren’t native! But not this time :)

Well to be honest it wasnt that I sat down and worked really hard to get the drivers working, good ole fedora had the dell D410 drivers installed natively! great success! I decided on Fedora simply because after my CCNA next month my next exam will be a redhat exam, and seeing as Redhat is no longer free to download and use fedora was the next best thing. I’m loving this operating system, clean fresh and easy…ish to use.

Nothing like sitting infront of a computer and being an absolute expert, to sitting infront of my new laptop and feeling like a complete, and utter failure. See you in the fedora forums really soon, asking really stupid questions.

Categories: Linux Tags: , , ,

Free Space Report:

Whether its for daily checks or a for a once off report this handy little script allows you to connect to as many servers as you like, query all local drives, report the capacity of the drives and the free space available. It writes all this information to a snazzy HTML file that is saved on the local disk.

This is a vbs file and uses a servers.txt (keep the txt file in the same location as the script) file as a reference for each of the servers you wish to connect to. I’ve tested this on up to 30 servers at a time with flawless output. This script can be run as a schedueled task and accross psexec. Just one point to note, if it is being executed from a UNC path, map the drive first or it will fail to lookup servers.txt

I use this script as a daily check to check up on all the file servers and exchange servers in the morning, combined with this Script this html file can be emailed to you or your team.

Heres an example of the html file you are finished with.

Server Utilization Report

Server1 Drive Utilization


C:\ Size: 20,003 MB Free: 8,791 MB |||||||||||||||||||||||||||||||||||||||||||| 43.95% Free
E:\ Size: 10,000 MB Free: 3,715 MB ||||||||||||||||||||||||||||||||||||| 37.15% Free

Created 26/02/2008 12:14:12 by morgan_a

For the code, click more…

Read more…