O script chama o script definido na variável $PS, remotamente em todos os servidores do Farm do SharePoint.
Script:
Add-PSSnapin Microsoft.SharePoint.PowerShell -erroraction SilentlyContinue
Write-Host -foregroundcolor Red "Executing $script on all servers in FARM $farm"
$farm = get-spfarm
$PS = Read-Host “Please provide the file path e.g. "c:\psscripts\script.ps1"
foreach ($server in $farm.servers)
{
if($server.Role -ne "Invalid")
{
invoke-command -computername $server.name -$filepath
}
}
Nenhum comentário:
Postar um comentário