Jump to content
Sign in to follow this  
Drewbacca

RunAs to copy files to network location

Recommended Posts

Drewbacca

Hi all,

I've been trying to find a way to be able to copy files to a network location where only the domain admin account has access. I was checking a bunch of RunAs posts but cannot seem to find a solution to my problem.

Here's one way I've tried to do this but you all are welcome to propose another way:

RunAs($adminuser, $admindomain, $adminpass, 2, 'cmd copy /Y c:\Temp\userinfo.log \\backup\user\userinfo.log', @SystemDir)

Ideally I would like to copy an entire folder but in this example it is just one file. The thing is that this is ran as a domain user and the network location is only accessible with the domain admin account.

Any ideas are very much appreciated.

Share this post


Link to post
Share on other sites
PsaltyDS

Hi all,

I've been trying to find a way to be able to copy files to a network location where only the domain admin account has access. I was checking a bunch of RunAs posts but cannot seem to find a solution to my problem.

Here's one way I've tried to do this but you all are welcome to propose another way:

RunAs($adminuser, $admindomain, $adminpass, 2, 'cmd copy /Y c:\Temp\userinfo.log \\backup\user\userinfo.log', @SystemDir)

Ideally I would like to copy an entire folder but in this example it is just one file. The thing is that this is ran as a domain user and the network location is only accessible with the domain admin account.

Any ideas are very much appreciated.

You didn't say what was wrong with what you already have...

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites
OchoNueve

If it works I would just go with it. Furthermore, if you need to copy all the files in that folder I am pretty sure all you need to do is go from this:

RunAs($adminuser, $admindomain, $adminpass, 2, 'cmd copy /Y c:\Temp\userinfo.log \\backup\user\userinfo.log', @SystemDir)

To this:

RunAs($adminuser, $admindomain, $adminpass, 2, 'cmd copy /Y c:\Temp\userinfo.log \\backup\user\*', @SystemDir)


[font="Times New Roman"]Ocho.[/font]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.