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 storage backup tools
Related Q&A from Brien Posey
Cloud security is a top concern for IT. As a result, keeping cloud backups secure should be a priority. Here are three straightforward guidelines to ... Continue Reading
Your upgrade method, workload and more affect whether the minimum hardware requirements for Windows 10 are really enough. Continue Reading
Rather than handling risk management and mitigation within your organization, outsourcing these important processes to a third party comes with ... Continue Reading
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.