copy Service pack and cu files in multiple server

To copy large files to SharePoint servers can be pain ful e.g. if  you are on monthly patch mode or have large farms.  below script can automated that.

# robocopy.exe source destination /mirror
$Servers = @("ServerA", "ServerB", "ServerC")
foreach($Server in $Servers)
{
    $Location = "\\$Server\e$\Binaries\SP2013SP1"
    Write-Host $Location
    Robocopy.exe E:\Binaries\SP2013SP1\ $Location /MIR 

}

##### OR ######

$Servers = Get-SPServer | ? { $_.Role -eq "Application" -or $_.Role -eq "WebFrontEnd"}
foreach($Server in $Servers)
{
    $Location = "\\$Server\e$\Binaries\SP2013SP1"
    Write-Host $Location
    Robocopy.exe E:\Binaries\SP2013SP1\ $Location /MIR 

}
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s