Solved

How to Script a Daily Windows Server 2008 Command-Line System State Backup

Posted on 2013-01-23
3
1,419 Views
Last Modified: 2013-02-08
My Windows Server 2008 Domain Controller has a 20GB C:\, and I have added a second 20GB D:\ drive for Daily System State backups (ONLY!).

Brief Story: After having witnessed a disaster at another company using 3rd party backup tools, I now know that a Veeam/vRanger/BackupExec backup will not backup Active Directory on a Windows 2008 correctly, so I want to script a daily System State backup using the Windows Server 2008 Backup feature. The GUI forces you to backup the whole server, when I only want the System State part.

The following command will run a System State backup to the server's D: drive:

 
WBADMIN START SYSTEMSTATEBACKUP -backuptarget:D:

Open in new window


BUT I want a script that does the following:

1. Script kicks off every day at 13:00
2. Checks for existing System State backups, if any exist, then delete
3. After existing backup is deleted, the a new System State backup should begin
4. On completion, a simple "System State backup was completed on" %Date%, %Time%" is appended to a text/log file e.g. D:\SysStateBkp.log

Has anyone completed a similar task before, or have any ideas?

Thanks,
Fin
0
Comment
Question by:cpadm
3 Comments
 
LVL 12

Expert Comment

by:Seaton007
ID: 38811220
You should be able to do this with Task Scheduler.
0
 
LVL 40

Accepted Solution

by:
Subsun earned 500 total points
ID: 38811877
Checkout this script from Script Center and see if it works for you, As mentioned above you can schedule this script daily to run at 13:00..

Folders and System State Backup using PowerShell script
http://gallery.technet.microsoft.com/scriptcenter/Folders-and-System-State-e60faab7
0
 
LVL 1

Author Closing Comment

by:cpadm
ID: 38868317
That weblink was very helpful in assisting us write a custom Powershell script to automate the creation of Windows DC system state backups.
0

Featured Post

Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
A procedure for exporting installed hotfix details of remote computers using powershell
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question