Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Copy Folder & files to remote servers

$
0
0

I am using simple powershell script to copy  files from  local system to remote servers. i am using  same command by changing  sever name every time

Copy-item -path "c:\softwares\xyz.exe" -destination "\\server1\c$\temp"

Copy-item -path "c:\softwares\xyz.exe" -destination "\\server2\c$\temp"

Copy-item -path "c:\softwares\xyz.exe" -destination "\\server3\c$\temp"

 it is very tough if i have to  do the same thing for more then 15 server.

please help me with some script.

server name can be picked from  1 txt file like 

It will be very much used if it ask for 2 credentials

it should check server connectivity with domain credential 

if it fails then it should check for remote server local admin credential

where credentials can be store in some variable when domain credential fails it should take remote server local admin credential 

serer name from C:\servers.txt


Thanks, jeevan




Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>