Roman Milert - Fotolia
Although Windows PowerShell is not a backup tool per se, it can be used to create data backups. In fact, there are several PowerShell backup scripts available for download.
For those who may be considering backing up data using PowerShell, there are several best practices to keep in mind.
Don't use internet scripting as-is
Even though there are some good PowerShell backup scripts available for download, none of those scripts should be used as-is. At the very least, you will probably need to modify the script to instruct PowerShell as to what data should and should not be backed up, and where to save the backup.
Additionally, a script might be designed to create a full backup every time that it is run, as opposed to creating an incremental or differential backup.
Be mindful of permissions
Another best practice for PowerShell backup scripts is to be mindful of permissions. When a PowerShell script runs interactively, that script inherits the permissions of the user who executed the script. It is possible, however, to force PowerShell to get its permissions from a different set of credentials by using the Get-Credential cmdlet.
This brings up an important point. When a script includes the Get-Credential cmdlet, the script will cause Windows to display a prompt asking the user to enter a set of credentials. If a script is designed to be automated, then such behavior is not desirable.
PowerShell makes it possible to export a set of credentials to an encrypted file. The file can then be used to supply credentials to a script. Such a file must, however, be carefully protected. Otherwise, someone could make a copy of the file and use it to supply credentials to other PowerShell scripts.
Don't rely on manual script execution
Finally, with PowerShell backup scripts, try not to rely on manual script execution. While there is nothing wrong with running a PowerShell script as a way of creating a one-off backup, a script is likely to be far more useful if it is configured to automatically run on a scheduled basis.
The Windows operating system includes a built-in tool for task automation, called Task Scheduler. By using Task Scheduler, you can automatically execute PowerShell backup scripts on a scheduled basis.
Dig Deeper on Data backup and recovery software
Related Q&A from Brien Posey
When backing up SAP HANA databases, having the right tools for the organization is critical. Data snapshots are one option, but not the only one ... Continue Reading
Public bucket access is a prevalent and discussed S3 security issue. However, there are several other important security measures to take, including ... Continue Reading
Tape still plays a key role in backup, including offline protection from ransomware. What are some key improvements that will keep tape backup ... Continue Reading