Export DHCP Reservations with Mac addresses:
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:
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.
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.
Recent Comments