I have a list of 150 computers on my Windows Active Directory network that I am trying to copy a files to. I wonder if someone might have a script that would, copy the files or shortcut to the computers by looking for the PC names in a text file.
-
Why wouldn't you do this with a group policy? – Zoredache Sep 28 '12 at 18:32
-
This would be pretty easy to do with PowerShell and not that complex. Are you not familiar with desktop/management scripting? – Brent Pabst Sep 28 '12 at 18:33
1 Answers
The right™ way to do this is to use a startup/logon script in GPO
or
Use a Group Policy File/Shortcut Preference item if your clients are Vista/7 or XP w/ the GPP Extensions add-on.
The reason that you don't want to do this the way that you proposed is that if a computer is not on or is unavailable or has a file locked, this won't work. A logon script or GPO gets around this restriction and guarantees that computers in your organization are compliant.
If you really want to use a script for this and feed it names, I recommend PowerShell. You can use Get-Content
to read the list and pipe it to a ForEach-Object
that will then contain a Copy-Item
command with a destination of \\$_\C$\Path\To\Copy\To
.
If you want more info on any of these cmdlets, just run Get-Help *command* -full
. For example, if you wanted the full details w/ examples of how Copy-Item
works, just run Get-Help Copy-Item -full
.

- 100,734
- 32
- 197
- 329
-
`s/logon/computer\ startup/`, depending upon where the file needs to be placed of course. – Bryan Sep 28 '12 at 18:56
-
-
i really dont want to user GPO to get this done i pretty do all my deployment using KACE. i already have a batch file to get this done i used to write VBS script. just checking if anyone already have a script they would be willing to share but thanks for the information guys – Alex Alexander Sep 28 '12 at 20:48
-
So, if you already use KACE for config management why aren't you using KACE for this? Also, GPO and config management tools like KACE are complimentary technology. Many large scale deployments leverage *both* technologies to keep their environment in good shape. – MDMarra Sep 28 '12 at 20:54
-