Solved

Batch file to stop and start remote DB service for backup

Posted on 2013-05-22
1
324 Views
Last Modified: 2013-05-27
I am wanting to backup some hyper-v guests that are running non vss aware databases.  The backup vendors all say I need to write batch files to stop and then restart the db service on the guest vm.
The backup software is on the host machine.  I can use psexec but I know I need to authenticate to the guest server.
What would script look like?
It will be a few hours before I can try it.
-SM
0
Comment
Question by:smantz
1 Comment
 
LVL 9

Accepted Solution

by:
jsdray earned 500 total points
Comment Utility
psexec has username / password options...

Usage: psexec [\\computer[,computer2[,...] | @file][-u user [-p psswd]][-n s][-l][-s|-e][-x][-i [session]][-c [-f|-v]][-w directory][-d][-<priority>][-a n,n,... ] cmd [arguments]

 use the runas command in your batch that you remotely execute with psexec

Syntax
runas [{/profile|/noprofile}] [/env] [/netonly] [/smartcard] [/showtrustlevels] [/trustlevel] /user:UserAccountName program
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

I was supporting a handful of Windows 2008 (non-R2) 2 node clusters with shared quorum disks. Some had SQL 2008 installed and some were just a vendor application that we supported. For the purposes of this article it doesn’t really matter which so w…
Sometimes drives fill up and we don't know why.  If you don't understand the best way to use the tools available, you may end up being stumped as to why your drive says it's not full when you have no space left!  Here's how you can find out...
The viewer will learn how to dynamically set the form action using jQuery.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

744 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now