?
Solved

script to move files from a virtual server to a USB drive on the host server

Posted on 2013-01-25
3
Medium Priority
?
396 Views
Last Modified: 2013-01-26
I have a Windows 2012 server that is a host to two 2008 virtual servers. There is USB drive connected to the server. It is recognized by the host but not by either of the virtual servers. I have a need to delete and copy files from one of the virtual servers to the USB drive. I would like to use a batch file to schedule a periodic operation. The problem I am having is the code to move across the servers.

Example of the setup and a simple line of code I am attempting:

hostserver has a USB Drive at H: on which there is a test directory.
vserver1
vserver2

The code resides on vserver1

rmdir /s/q "\\hostserver\H:\test"

The error that is returned is "the network name cannot be found."

If I can get the code to see across the server boundries the rest of the code will come easily.
0
Comment
Question by:gbm33
  • 2
3 Comments
 
LVL 43

Accepted Solution

by:
Steve Knight earned 2000 total points
ID: 38820625
Can you get to \\hostserver at all from the virtual one?  Are they are on the same domain for instance?  In fact are they on the same vlan / ip range - quite possible that host and clients can't actually communicate directly.

For starters can you do \\hostserver from the hostserver Run / search button itself?

How about \\x.x.x.x ip address from the virtual machine if needed?

Having got that working (or not) then you are best setting up a share on the USB drive, i.e. share the directory as "test" or whatever with suitable permissions for the share and for ntfs security -- if this isn't a domain you will need suitable login users and, for instance, setup mapped drive using user/password.

What you have at the moment won't work as there isn't going to be a share called H:, you could probably use the administrative share H$ but best creating a specific one.

Steve
0
 

Author Comment

by:gbm33
ID: 38821167
dragon-it: I have worked it out with your nudging.  After setting up a share for the USB Drive and allowing others to manipulate the data within the share I have to use a series of net use commands to ensure that I have logged into the hostserver and have permission to do what I desire to do.
0
 
LVL 43

Expert Comment

by:Steve Knight
ID: 38822105
Glad that helped.  You can do all and have it remembered:

net use /persistent:yes
net use x: \\hostserver\sharename /user:username password /savecred

If you have all you need select an answer when you are ready or can help more if needed.

Steve
0

Featured Post

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Question has a verified solution.

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

On a regular basis I get questions about slow RDP performance, RDP connection problems, strange errors and even BSOD, remote computers freezing or restarting after initiation of a remote session. In a lot of this cases the quick solutions made b…
Background Information Recently I have fixed file server permission issues for one of my client. The client has 1800 users and one Windows Server 2008 R2 domain joined file server with 12 TB of data, 250+ shared folders and the folder structure i…
Integration Management Part 2
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…

807 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