Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Server > Scripting > I need to Automate ForceFree-Tape cmdlet

Reply
Thread Tools Display Modes

I need to Automate ForceFree-Tape cmdlet

 
 
Victor Asuquo
Guest
Posts: n/a

 
      07-18-2009
I run DPM for backup and I take full daily backup of protection groups
daily. This involves rotating take include previously used one. Each time I
insert a new tape, I have to run this command

ForceFree-Tape.ps1 -DPMServerName MYDPMSERVER1 -LibraryName "Hewlett Packard
LTO Ultrium-3 drive" -TapeLocationList drive-\\.\TapeXXXXXXXX

I need a way to automate this and schedule it to runn daily. I have
researched this and came up with this solution that involves calling the
powershell script from a batch file that is written like this

powershell -command "& 'C:\ForceFree-Tape.ps1'"

I have schedule this batch file now to run daily at a set time. Testing this
fails but running the script directly from DPM Management shell works fine
however.

I need a way to get this script to running daily at a specific time. I need
help and all clues will be appreciated

Thanks in Advance

 
Reply With Quote
 
 
 
 
Rob Campbell
Guest
Posts: n/a

 
      07-18-2009
When a process works from the command line, but fails when run as a scheduled
task, I usually look for permission issues with the account or accounts that
are being used.

If you're using a different account for the scheduled process, does it have
the same permissions to the objects the script is handling as the one that
was used interactively?

Does the account that's being used for the scheduled process have "logon as
batch" rights on the machine where it is being run?



"Victor Asuquo" wrote:

> I run DPM for backup and I take full daily backup of protection groups
> daily. This involves rotating take include previously used one. Each time I
> insert a new tape, I have to run this command
>
> ForceFree-Tape.ps1 -DPMServerName MYDPMSERVER1 -LibraryName "Hewlett Packard
> LTO Ultrium-3 drive" -TapeLocationList drive-\\.\TapeXXXXXXXX
>
> I need a way to automate this and schedule it to runn daily. I have
> researched this and came up with this solution that involves calling the
> powershell script from a batch file that is written like this
>
> powershell -command "& 'C:\ForceFree-Tape.ps1'"
>
> I have schedule this batch file now to run daily at a set time. Testing this
> fails but running the script directly from DPM Management shell works fine
> however.
>
> I need a way to get this script to running daily at a specific time. I need
> help and all clues will be appreciated
>
> Thanks in Advance
>

 
Reply With Quote
 
Rob Campbell
Guest
Posts: n/a

 
      07-18-2009

Another possibility is that your console has a profile that's loading a
pssnapin with cmdlets the script uses, but the scheduled task isn't adding
that pssnapin.

"Victor Asuquo" wrote:

> I run DPM for backup and I take full daily backup of protection groups
> daily. This involves rotating take include previously used one. Each time I
> insert a new tape, I have to run this command
>
> ForceFree-Tape.ps1 -DPMServerName MYDPMSERVER1 -LibraryName "Hewlett Packard
> LTO Ultrium-3 drive" -TapeLocationList drive-\\.\TapeXXXXXXXX
>
> I need a way to automate this and schedule it to runn daily. I have
> researched this and came up with this solution that involves calling the
> powershell script from a batch file that is written like this
>
> powershell -command "& 'C:\ForceFree-Tape.ps1'"
>
> I have schedule this batch file now to run daily at a set time. Testing this
> fails but running the script directly from DPM Management shell works fine
> however.
>
> I need a way to get this script to running daily at a specific time. I need
> help and all clues will be appreciated
>
> Thanks in Advance
>

 
Reply With Quote
 
Pegasus [MVP]
Guest
Posts: n/a

 
      07-18-2009

"Rob Campbell" <> wrote in message
news84AB292-D053-424E-A521-...
> When a process works from the command line, but fails when run as a
> scheduled
> task, I usually look for permission issues with the account or accounts
> that
> are being used.


A further and often overlooked cause for such problems is "casual"
programming practices: Instead of fully qualifying all commands and files,
people tend to make assumptions that turn out to be invalid. In the current
case the OP assumes that the location of powershell.exe is listed in the
%path%. Perhaps it isn't. Robust programs would use code like this one:
"c:\Program Files\PowerShell\Powershell.exe" -command "&
'C:\ForceFree-Tape.ps1'".


 
Reply With Quote
 
David Allen
Guest
Posts: n/a

 
      07-20-2009
Hi Victor,

As well as the suggestions already posted to get you your scheduled task
running, you could use Operations Manager to perform this for you if you have
it in your environment.

I have a post that might be useful to you if this is an option
http://www.scdpmonline.org/creating-...s-manager.aspx

--
David Allen
MVP - Operations Manager 2007
http://wmug.co.uk/blogs/aquilaweb
http://www.scdpmonline.org


"Victor Asuquo" wrote:

> I run DPM for backup and I take full daily backup of protection groups
> daily. This involves rotating take include previously used one. Each time I
> insert a new tape, I have to run this command
>
> ForceFree-Tape.ps1 -DPMServerName MYDPMSERVER1 -LibraryName "Hewlett Packard
> LTO Ultrium-3 drive" -TapeLocationList drive-\\.\TapeXXXXXXXX
>
> I need a way to automate this and schedule it to runn daily. I have
> researched this and came up with this solution that involves calling the
> powershell script from a batch file that is written like this
>
> powershell -command "& 'C:\ForceFree-Tape.ps1'"
>
> I have schedule this batch file now to run daily at a set time. Testing this
> fails but running the script directly from DPM Management shell works fine
> however.
>
> I need a way to get this script to running daily at a specific time. I need
> help and all clues will be appreciated
>
> Thanks in Advance
>

 
Reply With Quote
 
Jonesy
Guest
Posts: n/a

 
      07-21-2009
You need to run:

C:\Windows\system32\windowspowershell\v1.0\powersh ell.exe -PSConsoleFile
"C:\Program Files\Microsoft DPM\DPM\bin\dpmshell.psc1" -noexit -command
"C:\ForceFree-Tape.ps1"


"Victor Asuquo" wrote:

> I run DPM for backup and I take full daily backup of protection groups
> daily. This involves rotating take include previously used one. Each time I
> insert a new tape, I have to run this command
>
> ForceFree-Tape.ps1 -DPMServerName MYDPMSERVER1 -LibraryName "Hewlett Packard
> LTO Ultrium-3 drive" -TapeLocationList drive-\\.\TapeXXXXXXXX
>
> I need a way to automate this and schedule it to runn daily. I have
> researched this and came up with this solution that involves calling the
> powershell script from a batch file that is written like this
>
> powershell -command "& 'C:\ForceFree-Tape.ps1'"
>
> I have schedule this batch file now to run daily at a set time. Testing this
> fails but running the script directly from DPM Management shell works fine
> however.
>
> I need a way to get this script to running daily at a specific time. I need
> help and all clues will be appreciated
>
> Thanks in Advance
>

 
Reply With Quote
 
VascoSputs
Guest
Posts: n/a

 
      07-23-2009
Thanks Guys, especially to Jonesy. I created a batch file with the command
you provided running the batch fle works, so scheduling this to run, I expect
complete success, the only little glitch there is that, the command prompt
window, does not close at the end of execution. This I attribute to the
-noexit parameter, or what do you think?
--
EdemObong


"Jonesy" wrote:

> You need to run:
>
> C:\Windows\system32\windowspowershell\v1.0\powersh ell.exe -PSConsoleFile
> "C:\Program Files\Microsoft DPM\DPM\bin\dpmshell.psc1" -noexit -command
> "C:\ForceFree-Tape.ps1"
>
>
> "Victor Asuquo" wrote:
>
> > I run DPM for backup and I take full daily backup of protection groups
> > daily. This involves rotating take include previously used one. Each time I
> > insert a new tape, I have to run this command
> >
> > ForceFree-Tape.ps1 -DPMServerName MYDPMSERVER1 -LibraryName "Hewlett Packard
> > LTO Ultrium-3 drive" -TapeLocationList drive-\\.\TapeXXXXXXXX
> >
> > I need a way to automate this and schedule it to runn daily. I have
> > researched this and came up with this solution that involves calling the
> > powershell script from a batch file that is written like this
> >
> > powershell -command "& 'C:\ForceFree-Tape.ps1'"
> >
> > I have schedule this batch file now to run daily at a set time. Testing this
> > fails but running the script directly from DPM Management shell works fine
> > however.
> >
> > I need a way to get this script to running daily at a specific time. I need
> > help and all clues will be appreciated
> >
> > Thanks in Advance
> >

 
Reply With Quote
 
Jonesy
Guest
Posts: n/a

 
      07-24-2009

Not a problem. Removing noexit should do the trick.

"VascoSputs" wrote:

> Thanks Guys, especially to Jonesy. I created a batch file with the command
> you provided running the batch fle works, so scheduling this to run, I expect
> complete success, the only little glitch there is that, the command prompt
> window, does not close at the end of execution. This I attribute to the
> -noexit parameter, or what do you think?
> --
> EdemObong
>
>
> "Jonesy" wrote:
>
> > You need to run:
> >
> > C:\Windows\system32\windowspowershell\v1.0\powersh ell.exe -PSConsoleFile
> > "C:\Program Files\Microsoft DPM\DPM\bin\dpmshell.psc1" -noexit -command
> > "C:\ForceFree-Tape.ps1"
> >
> >
> > "Victor Asuquo" wrote:
> >
> > > I run DPM for backup and I take full daily backup of protection groups
> > > daily. This involves rotating take include previously used one. Each time I
> > > insert a new tape, I have to run this command
> > >
> > > ForceFree-Tape.ps1 -DPMServerName MYDPMSERVER1 -LibraryName "Hewlett Packard
> > > LTO Ultrium-3 drive" -TapeLocationList drive-\\.\TapeXXXXXXXX
> > >
> > > I need a way to automate this and schedule it to runn daily. I have
> > > researched this and came up with this solution that involves calling the
> > > powershell script from a batch file that is written like this
> > >
> > > powershell -command "& 'C:\ForceFree-Tape.ps1'"
> > >
> > > I have schedule this batch file now to run daily at a set time. Testing this
> > > fails but running the script directly from DPM Management shell works fine
> > > however.
> > >
> > > I need a way to get this script to running daily at a specific time. I need
> > > help and all clues will be appreciated
> > >
> > > Thanks in Advance
> > >

 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Unable to detect tape drive or tape media. SBS 2003 Al Williams Windows Small Business Server 3 01-29-2007 03:14 PM
Re: Unable to detect tape drive or tape media. SBS 2003 Steven H Windows Small Business Server 0 01-26-2007 05:53 PM
RE: invoke a Cmdlet from a Cmdlet dreeschkind Scripting 0 08-15-2006 06:45 PM
Re: Travan Tape Drive Ejects Tape Automatically Dave Nickason [SBS MVP] Windows Small Business Server 0 02-10-2006 06:40 PM
Re: Travan Tape Drive Ejects Tape Automatically Steve Windows Small Business Server 1 02-10-2006 06:21 AM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59