kcalderw Posted May 17, 2016 Posted May 17, 2016 I've tried this both locally and via GPO and am having no luck. I have a folder sitting in c:\users\public that I want copied to each AD user's c:\users\%username%\AppData\Roaming\LOCAL\ folder on login. The script works fine if I browse to the location and manually run it. I cannot however, get it to auto run on login. GPO setting: https://drive.google.com/open?id=0B5WwyYQ7JxrsclhsTkg2THFiRUE The user definitely has privileges to the file, I am able to browse to the network share and run it manually.
sonofsanta Posted May 17, 2016 Posted May 17, 2016 Any reason you're not using Group Policy Preferences to copy the folder & files?
kcalderw Posted May 17, 2016 Author Posted May 17, 2016 (edited) Probably because I'm somewhat new to GP and didn't know about that. I only want the folder copied on 4 machines, and I do not need to have it copied on each login. The script I have now looks for a file and if that file is there nothing is done. If the file changes, then it'll copy it again. This helps when there is an update. Edited May 17, 2016 by kcalderw
sonofsanta Posted May 17, 2016 Posted May 17, 2016 Probably because I'm somewhat new to GP and didn't know about that. I only want the folder copied on 4 machines, and I do not need to have it copied on each login. The script I have now looks for a file and if that file is there nothing is done. If the file changes, then it'll copy it again. This helps when there is an update. GPP can do all that You can use item-level targeting to make sure it only runs on machines you want to run it on (or just apply the Group Policy Object on the relevant OU as normal), and if you use the Update action, it compares the files and only copies them over if the source is newer (where Replace always copies).
kcalderw Posted May 17, 2016 Author Posted May 17, 2016 Looks like if you have a folder with subfolders, the GPO option won't work. Everything I'm reading says run a script to copy the folder. https://community.spiceworks.com/topic/477478-copy-a-folder-to-user-s-desktop-via-group-policy I could never get the script to run but something I just came across says the COMPUTER must have read access to the file. How can I check that?
sonofsanta Posted May 18, 2016 Posted May 18, 2016 Ah, fair enough. Have you tried launching the script with User Config > Policies > Admin Templates > System > Logon > Run these programs at user logon? That delays the script until the desktop has appeared, and runs explicitly in the user context, so if they have permissions (to that folder on C:\ as well as the script file, wherever that is) it should work. Apply it to the OU containing the four computers you need and make sure loopback policy processing (Computer > Policies > Admin Templates > System > Group Policy > User Group Policy loopback processing mode = Merge) is on. Caveat: only one script can ever be run this way. If you already run another script this way, this policy will overwrite it, or be overwritten by it. It acts more like a normal group policy setting in that regard, where the more specific setting "wins", unlike the Windows Settings > Scripts section which accumulates and runs everything specified in every GPO.
sted Posted May 18, 2016 Posted May 18, 2016 ifmits for all users but only on 4 pcs why not just copy the script to the C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp folder on those pcs (wither with gpp or however
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now