Solved

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

Posted on 2014-12-11
6
678 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
6 Comments
 
LVL 24

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 78

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
Promote certifications in your email signature

Has your company recently won an award or achieved a certification? They'll no doubt want to show it off. Email signature images used to promote certifications & awards can instantly establish credibility with a recipient and provide you with numerous benefits.

 
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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Our Group Policy work started with Small Business Server in 2000. Microsoft gave us an excellent OU and GPO model in subsequent SBS editions that utilized WMI filters, OU linking, and VBS scripts. These are some of experiences plus our spending a lo…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This tutorial will walk an individual through setting the global and backup job media overwrite and protection periods in Backup Exec 2012. Log onto the Backup Exec Central Administration Server. Examine the services. If all or most of them are stop…
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…

707 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now