Jump to content

Recommended Posts

Posted

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.

Posted

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
Posted

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]

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
×
×
  • Create New...