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