6

I am wanting to create a GPO (other methods are open for discussion as well) for the issue below. Any and all help would be appreciated, thanks!

Users logs in, GPO creates a sub folder in C:\Users\%userprofile%\, then it copies a file from the DC itself to this sub folder.

Theoretically, unless the user logs onto a different machine, this would only have to happen once per user profile, per machine.

Jonas Lear
  • 460
  • 1
  • 3
  • 5

2 Answers2

13

You can create a Group Policy Preference to accomplish this.

Under User Configuration > Preferences > Windows Settings > Files create a new file.

Set the source file location \\your.domain\NETLOGON\file.txt

Set the destination: C:\Users\%logonuser%\myFolder\file.txt . Any non-existent parent folders in the destination will be created.

Then set the preference to Apply once and do not reapply

Josh
  • 427
  • 4
  • 13
  • Hi Josh, thank you for your answer. I followed what you put here step by step, even ran gpupdate, but nothing happened. I have a few people added to a security group to test out in the filtering, the sub folder was not created and the file was not transferred. Any ideas? – Jonas Lear Oct 06 '15 at 18:43
  • Is there anything in Event Viewer? Any errors? Does the user have access to the file in the Source? – Josh Oct 06 '15 at 18:57
  • Also, what is the user profile path? Make sure that `C:\Users\%logonuser%` resolves to their actual user profile path. Sometimes the domain gets added to that their profile folder (e.g. `C:\Users\USERNAME.DOMAIN`) – Josh Oct 06 '15 at 18:59
  • This setting might be applied only at logon and not during Group Policy refresh or when forcing a Group Policy refresh so try logging off and back on with one of your users. Also make sure that the users in question are in the Scope of Management of the GPO. – joeqwerty Oct 06 '15 at 20:51
  • you are not on xp or have group policy preferences extension on it if you are, right? – Adil Hindistan Oct 07 '15 at 01:49
  • Update on this... I found out why the GPO was not taking effect and have corrected it. GPRESULT specifies that the PC has the GPO attached. However, when I tried it again, it does the same thing, it is not applying. Checked eventvwr, found no errors on my PC or the DC issuing the GPO. BUT, the first time I tried this, I made a typo in the "Destination File" field and it actually created the user folder, the sub folder and copied the file there. So the GPO in a way worked but not when I corrected the spelling. – Jonas Lear Oct 07 '15 at 19:58
0

Unfortunately, officially copying files with GPO is limited to files - it will not create and copy the contents of sub-folders:

https://social.technet.microsoft.com/Forums/windowsserver/en-US/a9440802-22a4-4b8a-a84a-5e8bdf1db23c/copying-files-with-gpp-does-it-copy-subfolders?forum=winserverGP

Pity.