Solved

How to copy a file from share drive to local users c:\ drive, through group policy

Posted on 2014-12-11
6
1,064 Views
Last Modified: 2014-12-15
Hi,

Need help  to copy the file from share drive to local users c:\ drive, through group policy, while i using the below script it gives permission denied error. but it working fine with administrator login.

Below script work only with administrator rights.
Const OverwriteExisting = True
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objName= CreateObject("wscript.network")
objFSO.CopyFile "\\mumfilesvr204.iksad.local\Install\Pac_files\proxy.pac" , "C:\proxy.pac" , OverwriteExisting

Please suggest. Thanks in advance.
0
Comment
Question by:Swaroop Katargunde
[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
6 Comments
 
LVL 25

Expert Comment

by:Mohammed Khawaja
ID: 40493491
Can the user copy it without running as Administrator?   If that is the case then you have the choice of disabling UAC or maybe the user doesn't have rights to create file in C:\.  Have you tried copying the file to %temp%\ folder as everyone has rights to temp folder.
0
 
LVL 82

Expert Comment

by:David Johnson, CD, MVP
ID: 40493529
the root of c: is a protected area use a subfolder instead
0
 

Author Comment

by:Swaroop Katargunde
ID: 40493541
User doesn't have rights to copying the files rights.
I am using group policy -- logon script --to copy the file from share folder to users system i.e c:\
 Can you please suggest,
0
Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

 
LVL 24

Expert Comment

by:VB ITS
ID: 40493669
Use Group Policy Preferences instead to copy the file: http://technet.microsoft.com/en-au/library/cc772536.aspx
 
Although I haven't tested this with copying files to the root of the C:\ drive before it should work as long as you don't tick the "Run in logged-on user's security context (user policy option)" as this will try and copy the file to the C: drive using the logged on user's account. If you leave this box unticked (which it is by default) it will run under the SYSTEM account which does have Full Access to the root of the C: drive.
0
 
LVL 6

Accepted Solution

by:
Rob G earned 500 total points
ID: 40495005
Does the person have access to the file location?
If not you will need to run the script from an account that does.. Which is easy to do, and i will write you a basic script to get this done, (you'll need to add your creds etc) but keep in mind that data is passed in clean text over the network..

Basically what i would do..


Net use F: \\Network path to the folder where the file is\  /User: administrator pa$$word /persistent:No
mkdir c:\filemove
Copy f:\File.txt c:\filemove\
copy c:\filemove\file.txt c:\
net use f: /D
del c:\filemove /s /q
end

Copying it to a sub folder local, then to C itself should allow you to bypass the UAC complaint about the the file failing..
0
 
LVL 3

Expert Comment

by:v_2abhis2
ID: 40497402
Hello,

Try using the Group policy preference setting under the following location

Computer configuration - Preferences- Windows settings -file,

Now select the option replace in Action

Specify the share folder location using the UNC patch \\<servername>\sharename\<filename> in source file filed

C:\ <filename> in the destination file field.

this will copy the file over from the share to the local system c;\ drive

You can apply this policy on the OU or the domain
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Sometimes clients can lose connectivity with the Lotus Notes Domino Server, but there's not always an obvious answer as to why it happens.   Read this article to follow one of the first experiences I had with Lotus Notes on a client's machine, my…
This article provides a convenient collection of links to Microsoft provided Security Patches for operating systems that have reached their End of Life support cycle. Included operating systems covered by this article are Windows XP,  Windows Server…
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…
The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…
Suggested Courses

617 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