S
S
SterhXXX2020-03-31 10:27:51
Backup
SterhXXX, 2020-03-31 10:27:51

What rights need to be configured to copy another user's folders with a script over the network?

Required: copy the folder Users (Users) or document and settings of a domain user over the network to a special folder shared for this.
Possible option: separately copy the Desktop and/or Documents folder each to its own folder in a shared folder on the network.
Available:
- script
- admin rights in the domain
- a user created by a specialist only for this function.
- Windows Server 2003
- workstations on Windows 10, Windows 7, Windows XP.

What are my results today (03/31/2020):
- it is possible to copy any folder created on the local disk with a script.
- when copying the folder "Desktop" (Desktop) in Widows10 everything works fine
- when copying the Documents("C:\Users\111\Documents") and/or Users("C:\Users") folders, the script creates the required directory in the shared folder, but does not copy anything there.

I think problems with the rights and access to folders.

Answer the question

In order to leave comments, you need to log in

5 answer(s)
P
pfg21, 2020-03-31
@pfg21

chtonit type
runas / u: Administrator copy ....
option two: set up a task in the Task Scheduler with administrator rights.
option three: put a normal backup.

E
Eugene, 2020-03-31
@yellowmew

I would recommend approaching the problem from a different angle.
1. set up a shared network folder so that users (domain users) can create folders on it without inheritance, and the rights to subfolders are full for the creator owner and the admin domain (and you\your group if you are not an admin in the domain)
2. write a script (or rather, one-liner scripts - one per user folder) using robocopy to mirror the necessary folders to this shared folder from under the user account . Robocopy is included in win10\win7 and for windows xp - https://www.microsoft.com/en-us/download/details.a...
We look at the /mir /ZB keys - you can use the /MOT key to monitor changes: m
key /TBD is also likely to be needed - you have a network folder
there is also the possibility of finer tuning - study the available keys. on
WinXP, perhaps, the set of keys will be different, but the main functionality will be the
same
folder, but you can run one script for everything, all the same, Robocopy collective
farms will remain hanging in memory and doing synchronization. On 6TB file servers at the moment it does an excellent job of synchronizing with minimal memory consumption. Restarting the task is needed in case of problems.
The advantage of this option is that those files to which the user has access will be copied - problems with rights are excluded. If copying fails, then access to the file, even for reading, is directly prohibited by the system, that is, you will not copy it anyway.
Complexity (minimum) - in an adequate setting of the network folder itself where everything will be copied, otherwise it can be turned not into a mirror of user files, but into a file dump where everyone has access everywhere.
Advice: forget about cmd
Advice for the future: do not collective farm. You have AD, which means that network folders of user files with branch cache are available if necessary in case of poor Internet between the file server and the user

A
antonwx, 2020-03-31
@antonwx

There is one simple option: run the task on behalf of the system using psexec:
psexec -isd program.exe

D
Dimonchik, 2020-03-31
@dimonchik2013

I think problems with the rights and access to folders.

in the army, commanders think for you,
and in the OS, administrators
look at the logs and solve a local problem, fix it, solve it further

K
Konstantin Tsvetkov, 2020-03-31
@tsklab

Remove 2>nul >nuland you will see errors.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question