Today I wanted to go through the PowerShell script I use to backup all the DHCP servers in our Windows domain. The script is a few years old now and I have a feeling there is probably a better way to do it, so look out for an updated script in the future over on my GitHub page. For the moment however this is the one I use.
A few things about this script:
- It uses the cmdlet Write-Zip which is part of the PowerShell community extensions.
- You need to configure the $LocalBackup and $BackupServer variables.
- The script will check to see if each server has already been backed up on the day it is run and will skip the server if it has.
- A local backup is done on the DHCP server before being copied to the backup server.
- If you don’t have the DHCP cmdlets available you might need to install the Remote Server Administration Tools for your operating system.