The wbadmin CommandLine Tool
The wbadmin utility is available on both the standard and the Server Core installations of Windows Server 2008. It enables you to do everything you can do with Windows Server Backup and more . When you install the Windows Server Backup feature and select Command-Line Tools, as shown in Figure 8-5, the wbadmin utility is installed on a standard installation of Windows Server 2008.
On a Server Core installation, wbadmin is the only direct backup utility you can use, although it is possible to connect to the computer remotely by using the Windows Server Backup console . You can install wbadmin on a computer running in the Server Core configuration by running the Command Prompt console as an administrator and entering the command:
Ocsetup WindowsServerBackup
The following wbadmin.exe commands are useful for backing up Windows Server 2008 files:
■ wbadmin enable backup Enables you to create and manage scheduled backups
■ wbadmin start systemstatebackup Performs a system state data backup
■ wbadmin start backup Starts a single manual backup
■ wbadmin get versions Displays details of backups that have already been taken
■ wbadmin get items Enables you to determine which items are contained in a specific backup image
- FIGURE 8-5 Installing command-line tools .
With the wbadmin start backup command, you carry out manual backups to shared folders by using the -backuptarget:\\Share\Folder syntax where the shared folder location is expressed as a UNC pathname . If it is necessary to provide authentication credentials to write data to the shared folder, you can use the -user: and -password: options . For example, to back up volume E to the shared folder store on the server Glasgow, using Kim Aker's credentials, you would enter the command:
Wbadmin start backup -backuptarget:\\Glasgow\Store -include:E:-User:Kim_Akers@contoso.internal -Password:P@ssw0rd
You can issue wbadmin.exe commands from a batch file, and you can schedule batch file operation with the Scheduled Tasks utility. Using this method, you can schedule the execution of more accurately timed backups than is possible using Windows Server Backup scheduling options . You can configure scheduled backups to network locations . For example, the following command creates a batch file named ssbackup .bat in the c:\scripts directory that will perform a system state backup to the \\Server\Share network share, using the credentials of RemoteUser:
Echo wbadmin start systemstatebackup -backupTarget:\\Server\Share -user:RemoteUser -password:RemotePassword -quiet >> c:\scripts\ssbackup.bat
You can use Scheduled Tasks to configure this batch file to run according to a schedule If you plan backups by using this method, note the following points:
■ The -quiet option is required in the wbadmin command because you do not want a scheduled task to halt while waiting for input .
■ The scheduled task must be run using the local Administrator account because wbadmin.exe runs with elevated privileges .
■ If the scheduled task is writing to a network share, you need to put user account credentials into the script called by the scheduled task. You can protect these credentials by using encrypting file system (EFS) or Active Directory Rights Management Service (AD RMS) to encrypt the file so that only the local Administrator account can view the script contents
■ Scripted backups fail if the target location is full. Backups scheduled using wbadmin. exe will automatically remove the oldest backup when not enough space exists for the current backup
Post a comment