Copying Files using startup script

  • Thread starter Thread starter Brian
  • Start date Start date
B

Brian

Hi

Is it possible to create a startup script that will copy
files from a server location, as opposed to a logon
script?
 
Brian said:
Please Ignore, problem sorted.
No, please don't ignore.

I have a problem with this.

Here is the setup

I have some computers in Domain A that I have set a logon script for
via a computer GPO

The startup script is a .cmd file with something like

@echo Is this working?>c:\localfiles\test.txt
@xcopy \\serverB\share\files\*.* c:\localfiles\ /y

The test.txt file gets created fine, so I know the script is
executing. And if I run the command at a run line after I log in, it
works, so I know the syntax is correct. Problem is the files are not
copying down to the computers durring the startup script. I know this
is a rights issue on the share, but Iam having a hard time figuring
out what rights I need to assing on the share.

So, who do I give rights to on ServerB\Share. There is a fly in the
ointment. ServerB is on a different DOMAIN than the computers, but
they are in the same AD forrest and there is a trust (don't know if
that is still the right term) between them. I have tried granting
rights to Domain Computers from Domain A and I have tried
authenticated users but neither of these works. I can copy files from
a server on Domain A fine, but I have to grant rights to Domain Users,
and I kind of want to avoid that.

I got this working

@xcopy \\serverA\share\files\*.* c:\localfiles\ /y where ServerA is on
the same domain as the computers.

I have read through many posts on here and have surmised that startup
scripts run as NT AUTHORITY\SYSTEM but how do I get that account to be
able to copy stuff off the network. Is it even possible without
opening up the share to everyone?

I have tried adding the computers to a group and giving that group
rights on the share but I couldn't get that to work either. Should
it? Because that seems like the best way to go from a security
standpoint.
 
As a workaround, you could always create a dedicated account for this and
then map a drive as this user, copy your files and disconnect the drive.
Obvioulsy there are secuity issues related to this approach since you would
have to put the credntials in clear text in the script. If you would write a
VBscript instead, Microsoft has a tool called screnc.exe that encrypts (not
very strong encryption) VBscript files so they can not be rad in clear text
when opened. This might be an acceptable solution for you if you make sure
you limit this accounts access as much as possible

Regards

Niclas Lindblom
 
I would give "authenticated users" full control on the SHARE permissions and
change rights on the NTFS permissions.

Then try this (or something like this). name it whateveryouwant.vbs

Dim WshShell, objFSO

Set WshShell = Wscript.createobject("Wscript.shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")

objFSO.CopyFolder "\\serverA\share\files", "c:\localfiles"

Set WshShell = Nothing
Set objFSO = Nothing

------------------------------------------------------------

That should use the default script host to copy the network folder over to
the destination location on the PC. I do it all the time in my startup
script.

Jared
 
Back
Top