Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 8583

copy file to multiple computers

$
0
0

Hi

im trying to copy a file from one computer to multiple servers.

I want to use a txt (Srvlist.txt) file containing the servers name.

but I get an error that the path cannot be found.

I can copy the file manualy to the UNC path.

 

this is the script:

 

$a = Get-Content "D:\Scripting\Srvlist.txt"
foreach ($i in $a)

{Copy-Item D:\Scripting\TestCopy.txt -Destination \\$i\C$\temp -force}

 

thanks,


Viewing all articles
Browse latest Browse all 8583

Trending Articles