CaussyR
asked on
Copy a file to several remotw servers in the same domain
I need to copy a single file to approximately 50 servers. I want to use PowerShell to do this and tried the following :
$ServerList=IMPORT-CSV D:\temp\BGInfo\ServerList. csv
foreach ($Server in $ServerList)
{
Copy-Item -path 'd:\temp\bginfo\2K8Server_ Default.bg i' -Destination “\\$_\C$\BGINFO” -force
}
When I run it, I see the following error message :
Copy-Item : The network path was not found.
At line:5 char:1
+ Copy-Item -path 'd:\temp\bginfo\2K8Server_ Default.bg i' -Destination “\\$_\C$\BGI ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~ ~~~~~~~~~~ ~~~~~~~~~~ ~~~~~~~~~~ ~~~~~~~~~~ ~~~~
+ CategoryInfo : NotSpecified: (:) [Copy-Item], IOException
+ FullyQualifiedErrorId : System.IO.IOException,Micr osoft.Powe rShell.Com mands.Copy ItemComman d
Can anyone help me resolve this issue.
Thanks.
$ServerList=IMPORT-CSV D:\temp\BGInfo\ServerList.
foreach ($Server in $ServerList)
{
Copy-Item -path 'd:\temp\bginfo\2K8Server_
}
When I run it, I see the following error message :
Copy-Item : The network path was not found.
At line:5 char:1
+ Copy-Item -path 'd:\temp\bginfo\2K8Server_
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Copy-Item], IOException
+ FullyQualifiedErrorId : System.IO.IOException,Micr
Can anyone help me resolve this issue.
Thanks.
ASKER
Thanks for your reply, but when I run the script I still see the following : Copy-Item : The network path was not found.
The network path does exist as I have browsed to each location.
The network path does exist as I have browsed to each location.
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
Open in new window