Powershell Copy file to listed servers

Copy file to listed servers.


$server_names = Get-Content "C:\Servers_list.txt"
Foreach ($server in $server_names){
             Copy-Item "source-file-path" -Destination "\\$server\destination-file-path-to-save" -Recurse
}

Comments

Popular posts from this blog

Troubleshooting Netlogon Error Codes

Service Principal Names (SPNs) SetSPN Syntax (Setspn.exe)

Troubleshooting AD Active Directory Replication Error 8456 or 8457: "The source | destination server is currently rejecting replication requests"