?
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
?
378 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Office 365 Training for Admins - 7 Day Trial

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

Question has a verified solution.

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

Have you considered what group policies are backwards and forwards compatible? Windows Active Directory servers and clients use group policy templates to deploy sets of policies within your domain. But, there is a catch to deploying policies. The…
Being a system administrator some time we require to do things remotely, one of them is installing software. Here I am going to tell you how to install software through wmic (Windows management instrument console). I am not at all saying that this i…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

777 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