Answered by:
Group policy preferences copy files
Question
-
Thru a GPP i want to copy some files to the desktop if the client machine is a laptop. Because i cannot find a hardware profile anymore in WIndows7 Pro i decided to use a target item: battery or computername is laptop. Because our names starts with laptops i have tried: laptop*.* in the targeting item.
What i have done in the Gpp files:
Source: \\server\share\*.*
Target: \\%userprofile%\desktopIn the share sourcce there are 2 .reg files that must be copied to the users or all users desktop. As targeting item i have chosen battery.
So i thought if the client machine has a battery those two files are beiing copied, but it doesn't work..
There are no files on the users deskto.
The user is a limited user, but the user has rights to the desktop so that can not be the couse.Can it be that *.* in the source is nog working?
Where can i troubleshoot why the files aren't copied?
Is it possible to item targetting a name which starts with, lets say "laptop" and use laptop*.*?
freddie
Answers
-
Surfer10,
I don't know what GPP you use but I am sure the solution I gave you works. And yes, I tested it and use it this way!
Go to GPP Files - New file, choose Replace and in File source browse till the place you have the files you want to push on the users desktop. Chose one and then replace its name with * and not *.*. Click OK. In the target file, press F3 and from the list choose Desktopdir and if you want the files be on a folder on the user's desktop, use \folder.
The final look of these actions would be :
in File source : \\server\share\*
in Target folder : %DesktopDir%\folder
All replies
-
Hi,
To troubleshoot the issue, you can start with the Group Policy event log on the client. I would also suggest trying the operation without any item level targeting to narrow down the issue between the copy and targeting. Note that if you want to use a wild card on the computer name, you would use laptop*.
Also, make sure that the user has the rights for the test. They not only need local rights to the target, then need rights to the source (share and folder). This can easily be tested by running the copy as the user interactively.
Thanks,
Guy
-
You can use the "Portable Computer Targeting" option to target to just laptops... this way you wont target Desktops that have a USB UPS connection attached.... See http://technet.microsoft.com/en-us/library/cc754547.aspx
As for troubleshooting enable the "Configure Files preference logging and tracing" to troubleshoot why the file is not working See http://gps.cloudapp.net/Default.aspx?PolicyID=4912
Hope it helps
Alan Burchill (MVP)
http://www.grouppolicy.biz
Follow me on twitter @alanburchill- Proposed as answer by Alan Burchill Thursday, February 24, 2011 5:38 AM
-
You can use the "Portable Computer Targeting" option to target to just laptops... this way you wont target Desktops that have a USB UPS connection attached.... See http://technet.microsoft.com/en-us/library/cc754547.aspx
As for troubleshooting enable the "Configure Files preference logging and tracing" to troubleshoot why the file is not working See http://gps.cloudapp.net/Default.aspx?PolicyID=4912
Hope it helps
Alan Burchill (MVP)
http://www.grouppolicy.biz
Follow me on twitter @alanburchillI have no logs in the computer configuration. So thats also in the document. Downloaded the preferences and indeel in c:\program files is a subfolder called: group policy preferences. Choosing the language and there is a .adm file. I have copied this file in the c:\windows\inf on my local Windows 7 machine. Still no logs in the policy. Having closed gpmc.msc but no logs.
Must there be done something else to see the logs in the computer configuration - administrative templates - system - group policy=logs?
And is this the right way to copy files to the users desktop windows 7?:
Source: \\server\share\*.*
Target: %userprofile%\desktop
I have also tried: %logonuserr%\desktop
freddie -
I can't see the gpo add in for the logging van group policy preferences. On the WIndows 7 machines i thought that the gpo are in the c:\windows\inf so i put the adml file in this folder. Must i import that file into the GPO administrative templates?
freddie -
No i have tried almost everything:
In the source exact file name with share like: \\servershare\file_name.reg
As destination: %userprofile%\desktop and %logonuser%\desktop and c:\exactusername\desktop\fil_name.reg also *.* as filename source and destination. No icons appears on the user desktop after restarting or forcing the gpp.
Above with and without Item level targeting. With and without Apply once do not reapply.The source share has read rights for everyone.
What can this be?
freddie -
-
-
Hi,
For troubleshooting, please enable Configure Files preference logging and tracing setting under the Computer Configuration\Policies\Administrative Templates\System\Group Policy node.Enabling Group Policy Preferences Debug Logging using the RSAT
http://blogs.technet.com/b/askds/archive/2008/07/18/enabling-group-policy-preferences-debug-logging-using-the-rsat.aspxFor Windows XP, the log file is located in the folloiwng folder.
%SYSTEMDRIVE%\Documents and Settings\All Users\Application Data\GroupPolicy\Preference\TraceFor Windows 7, the log file is located in the folloiwng folder.
%SYSTEMDRIVE%\ProgramData\GroupPolicy\Preference\Trace
For your convenience, I have created a workspace for you. You can upload the log files to the following link. (Please choose "Send Files to Microsoft")
Workspace URL: (https://sftasia.one.microsoft.com/ChooseTransfer.aspx?key=e328cab0-cad0-4490-aaef-e115f0531b59)
Password: 6#pMuccrvZ
Brent
Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. ” -
Hi,
For troubleshooting, please enable Configure Files preference logging and tracing setting under the Computer Configuration\Policies\Administrative Templates\System\Group Policy node.Enabling Group Policy Preferences Debug Logging using the RSAT
http://blogs.technet.com/b/askds/archive/2008/07/18/enabling-group-policy-preferences-debug-logging-using-the-rsat.aspxFor Windows XP, the log file is located in the folloiwng folder.
%SYSTEMDRIVE%\Documents and Settings\All Users\Application Data\GroupPolicy\Preference\TraceFor Windows 7, the log file is located in the folloiwng folder.
%SYSTEMDRIVE%\ProgramData\GroupPolicy\Preference\Trace
For your convenience, I have created a workspace for you. You can upload the log files to the following link. (Please choose "Send Files to Microsoft")
Workspace URL: (https://sftasia.one.microsoft.com/ChooseTransfer.aspx?key=e328cab0-cad0-4490-aaef-e115f0531b59)
Password: 6#pMuccrvZ
Brent
Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. ”
Thx, but this doesn't succeed yet. I have downloaded the adml file and installed it and copied it to my WIndows 7 machine in the c:\windows\inf and the c:\program files. But i still don't see the logging node in Group Policy.
What more must i do to enable logging.I now have narrowed the problem down.
If i do a copy in GPP from for example: c:\filename and the target: c:\temp\filename with item level targeting name=laptop* then the filecopy succeed, but when i use as a target: %userprofile%\desktop or %logonuser%\desktop it goes wrong.
It goes also wrong when i use as a source a share like: \\server\share\filename and target: c:\temp
freddie -
just succeeded to copy 1 file. *.* or *.extension doesn't work.
I have to add the domain computers to the share reading rights.
Then it does not work when i use:
%userprofile%\desktop or %logonuser%\desktopIf i want to copy to a desktop how to use this in the target?
freddie -
Am 28.02.2011 13:57, schrieb surfer10:
Then it does not work when i use:
%userprofile%\desktop or %logonuser%\desktopCommon Tab: Run in logged on user context
Mark
Mark Heitbrink - MVP Windows Server - Group Policy
Homepage: www.gruppenrichtlinien.de - deutsch
GPO Tool: www.reg2xml.com - Registry Export File Converter
NNTP Bridge: http://communitybridge.codeplex.com/releases- Marked as answer by Brent HuModerator Wednesday, March 2, 2011 2:28 AM
- Unmarked as answer by Brent HuModerator Thursday, March 3, 2011 8:35 AM
-
-
Am 28.02.2011 14:54, schrieb surfer10:
This item is greyed out?
because you configured it inside the computerconfiguration.
You can not copy files userbased on a computer config.Copy them as the user, that should have them, otherwise you can
a) have security problems, like now
b) you can not resolve %username% as a computerMark
Mark Heitbrink - MVP Windows Server - Group Policy
Homepage: www.gruppenrichtlinien.de - deutsch
GPO Tool: www.reg2xml.com - Registry Export File Converter
NNTP Bridge: http://communitybridge.codeplex.com/releases- Marked as answer by Brent HuModerator Wednesday, March 2, 2011 2:28 AM
- Unmarked as answer by Brent HuModerator Thursday, March 3, 2011 8:35 AM
-
Ok i am now trying under a user OU.
So the GPP edit under a users configuration (users OU) and
If i use %userprofile%\desktop and select run in users context the file must be copied?Because i have tried several things now and i was wundering if i can copy 2 files like this: *.* if it are more files with different extensions and if the extensions are the same i use: *.reg
Is it possible to copy more files with GPP in one entry?
freddie -
Surfer,
Yes, it is possible to copy more than one file in one entry. Use in the Source folder wildcards (*, ?) : i.e. \\server\share\*
In the Target, click on F3 and choose DesktopDir (%DesktopDir%) from the list that appears.
- Marked as answer by Brent HuModerator Wednesday, March 2, 2011 2:28 AM
- Unmarked as answer by Brent HuModerator Thursday, March 3, 2011 8:35 AM
- Proposed as answer by Maroun Tannous Monday, March 13, 2017 3:32 PM
-
Thx. The thread is almost doen for me.
I was wundering though when i make the GPP a User preference and i wan't it to apply once then it is only run once for a user. So when the user is logged on to another laptop it isn't run anymore.
Thatswhy i made the copy files action under the computerconfiguration. I thought run it once in a computer so it is for everu user on that computer.
freddie -
I still can't get this done.
Am now using the user preference. the command i have now is:
source:\\server\share\*
Target: %desktopdir%\*In the source there are 2 .reg files which i want to place on every users on laptops.
However the files are not copied to the desktop when i restart the laptop several times...What is wrong in this case
freddie -
-
Surfer10,
I don't know what GPP you use but I am sure the solution I gave you works. And yes, I tested it and use it this way!
Go to GPP Files - New file, choose Replace and in File source browse till the place you have the files you want to push on the users desktop. Chose one and then replace its name with * and not *.*. Click OK. In the target file, press F3 and from the list choose Desktopdir and if you want the files be on a folder on the user's desktop, use \folder.
The final look of these actions would be :
in File source : \\server\share\*
in Target folder : %DesktopDir%\folder
-
The answer helped to workaround http://social.technet.microsoft.com/Forums/en/winserverGP/thread/64751af5-52c9-4aec-a1db-17f198051036
Thank you.
-
After hours of running this through in a lab, I finally figured out the issue.
If your doing a FILE copy the name of the SOURCE FILE needs to be supplied and the name of the destination file needs to be stated.
NOT WORKING:
Source file \\servername\sharename\filename
Destination file %desktopdir%\
The above is a PATH not a FILE
You will get a file not found issue. It makes sense thought to copy this file from this spot to this directory.
However, you need to specify the source filename and the destination file name.
WORKING:
Source file \\servername\sharename\filename
Destination file %desktopdir%\filename
Example:
Source \\server1\share1\filename1.bat
Destination \\%desktopdir%\filename1.bat
I found if you did *.extension or *.* it worked fine as well.
If you enter a explicit file name in the source directory it did not.
I've tested and it works correctly now.
Tips:
Use User Configuration GPP
In Common select "Run in logged-on user's security context"
In destination file press F3 you will get a menu to choose variables from. I can't confirm but I read that you can't use system variables, as they are different then GPP variables. IE %desktop% (system) vs %desktopdir% (GPP).
Hope this helps.
-
Hello
I was near killing my self about failures :D even trying all the above
The solution was checking the: "run in logged-on user's security context" on Common tab. Maybe because in my domain the users are restricted standard users.
With this option worked the both solutions
Source: \\server\share\*
Target folder:
- %DesktopDir%\folderX
- C:\Users\%username%\Desktop\folderX
- Proposed as answer by emirjonb Friday, October 24, 2014 9:13 AM
-