RE: task scheduler, wbadmin and bat files



Dear Customer,

Thank you for posting in newsgroup.

According to the description, the issue seems to be related to Wbadmin
syntax in a task scheduler. It seems when you specifies -user and -password
options in the schedule task, it does not work even with the -quiet option.

Analysis and Suggestion:

Based on the research, this is expected behavior, WBADMIN by default uses
interactive output and asks user to continue. If you want to use it with
Task Scheduler i.e. in non-interactive mode; you may need to use -quiet
option. The "-quiet" option is used to run the subcommand with no prompts
to the user. It seems that we will be prompted to confirm the backup if
this option is not configured. In a scheduled task environment, as it runs
in the system account without interactive dialog, the system may wait for
the confirmation forever so the backup could not proceed.

I understand that you are not able to run the command while using -user and
-password even if with -quiet option.

Please try the following steps:

1. Please make sure the schedule task is being run at highest privileges in
the scheduled task.

2. Please kindly try to run the command in command-line; This situation can
happen if your username/password are incorrect. WBADMIN will prompt for the
credential and in non-interactive mode it will go in hung state.

For example:

1. When we specify a schedule task to start a program at a specific time
with syntax -quiet, the system will start a backup without user interaction.

Program to start: C:\Windows\System32\Wbadmin.exe

Add arguments:

start backup -backuptarget:\\192.168.1.20\backup -include:e:
-user:nwtrader\test -password:<Password> -quiet

2. However, if we specify a scheduler task to start a program at a specific
time without syntax -quiet, the system will pop up a command line which ask
us "Do you want to start the backup operation?". Thus, the backup operation
won't begin until we may input Y to confirm the operation.

Program to start: C:\Windows\System32\Wbadmin.exe

Add arguments:

start backup -backuptarget:\\192.168.1.20\backup -include:e:
-user:nwtrader\test -password:<Password>

Please note: in the example, the user account nwtrader\test need to have
backup privilege on both the source and target server.

For the syntax of Wbadmin, please refer to:

Wbadmin start backup
http://technet.microsoft.com/en-us/library/cc742083.aspx

For your more information, I have included a blog which shows to run a
scheduled systemstatebackup in a bat file.

Windows Server 2008: Creating and Maintaining System State Backups on Your
Domain Controller
http://blogs.southworks.net/aalvarez/2008/05/27/windows-server-2008-creating
-and-maintaining-system-state-backups-on-your-domain-controller/

Hope the information will be helpful for you.

David Shen
Microsoft Online Technical Support

.