Home Tips & Resources Copy files to every users profile
 
Copy files to every users profile PDF Print E-mail
Written by Travis Nuske   
If you feel this tip has saved you time or effort, please consider buying us a cuppa coffee to keep things going!

Consider the scenario:

You have a folder of files that need to be copied to every users roaming profile folder on the server, but you can't use a login script.

Your profle's home folders are stored in D:\Users and the files you wish to copy is in d:\tocopy

Powershell Script

powershell -command "get-childitem D:\Users\*\* | foreach ($_) { Copy-Item -Path d:\tocopy\* -Recurse -Destination $_ -Force}"

This script will copy the contents of the "tocopy" folder into each folder within d:\users into the same path.

For example if you had the following folder d:\tocopy\Library\Preferences\Microsoft, the script will copy the Microsoft folder into each user's Library\Preferences folder

Last Updated on Thursday, 03 March 2011 15:45
 

Add comment


Security code
Refresh