在解决方案部署和/或功能激活期间,我偶尔会看到此错误...
复制此文件失败。此操作使用无法联系到的 SharePoint 管理服务 (spadmin)。如果该服务已停止或禁用,请启动它并再次尝试该操作。
以下是用于部署的 PowerShell 脚本:
$programfiles_path = $null
$stsadm_path = $null
$url = $null
$solution = $null
$feature = $null
$appPoolName = $null
$url = "http://" + ${env:COMPUTERNAME}
$programfiles_path = ${env:ProgramW6432}
if ($programfiles_path -eq $null)
{
$programfiles_path = ${env:ProgramFiles}
}
$stsadm_path = $programfiles_path + "\common files\microsoft shared\web server extensions\12\bin\stsadm.exe"
if(!(test-path $stsadm_path))
{
echo "stsadm.exe was not found: $stsadm_path"
exit -1
}
ECHO "***********************************"
ECHO "*** Contoso.Common.SolutionPackage ***"
ECHO "***********************************"
$solution = "Contoso.Common.SolutionPackage.wsp"
ECHO "*** add the solution ***"
& $stsadm_path -o addsolution -filename $solution
if ($? -eq $false) { exit }
ECHO "*** execute admin jobs ***"
& $stsadm_path -o execadmsvcjobs
if ($? -eq $false) { exit }
ECHO "*** deploy the solution ***"
& $stsadm_path -o deploysolution -name $solution -immediate -allowgacdeployment -url $url -force
if ($? -eq $false) { exit }
ECHO "*** execute admin jobs ***"
& $stsadm_path -o execadmsvcjobs
if ($? -eq $false) { exit }
$feature = "Contoso.Common.Infrastructure"
ECHO "*** activate feature(s) ***"
& $stsadm_path -o activatefeature -name $feature -url $url -force
if ($? -eq $false) { exit }
ECHO "*** execute admin jobs ***"
& $stsadm_path -o execadmsvcjobs
if ($? -eq $false) { exit }
$feature = "Contoso.CustomCAS"
ECHO "*** activate feature(s) ***"
& $stsadm_path -o activatefeature -name $feature -url $url -force
if ($? -eq $false) { exit }
ECHO "*** execute admin jobs ***"
& $stsadm_path -o execadmsvcjobs
if ($? -eq $false) { exit }
$feature = "Contoso.Common.WebParts"
ECHO "*** activate feature(s) ***"
& $stsadm_path -o activatefeature -name $feature -url $url -force
if ($? -eq $false) { exit }
ECHO "*** execute admin jobs ***"
& $stsadm_path -o execadmsvcjobs
if ($? -eq $false) { exit }
$feature = "Contoso.ExcelExtender"
ECHO "*** activate feature(s) ***"
& $stsadm_path -o activatefeature -name $feature -url $url -force
if ($? -eq $false) { exit }
ECHO "*** execute admin jobs ***"
& $stsadm_path -o execadmsvcjobs
if ($? -eq $false) { exit }
ECHO "*********************************"
ECHO "*** Contoso.Something ***"
ECHO "*********************************"
$solution = "Contoso.Something.wsp"
ECHO "*** add the solution ***"
& $stsadm_path -o addsolution -filename $solution
if ($? -eq $false) { exit }
ECHO "*** execute admin jobs ***"
& $stsadm_path -o execadmsvcjobs
if ($? -eq $false) { exit }
ECHO "*** deploy the solution ***"
& $stsadm_path -o deploysolution -name $solution -immediate -allowgacdeployment -url $url -force
if ($? -eq $false) { exit }
ECHO "*** execute admin jobs ***"
& $stsadm_path -o execadmsvcjobs
if ($? -eq $false) { exit }
$feature = "Contoso.Something"
ECHO "*** activate feature(s) ***"
& $stsadm_path -o activatefeature -name $feature -url $url -force
if ($? -eq $false) { exit }
ECHO "*** execute admin jobs ***"
& $stsadm_path -o execadmsvcjobs
if ($? -eq $false) { exit }
ECHO "*********************************"
ECHO "*** Contoso.Nothing ***"
ECHO "*********************************"
$solution = "Contoso.Nothing.wsp"
ECHO "*** add the solution ***"
& $stsadm_path -o addsolution -filename $solution
if ($? -eq $false) { exit }
ECHO "*** execute admin jobs ***"
& $stsadm_path -o execadmsvcjobs
if ($? -eq $false) { exit }
ECHO "*** deploy the solution ***"
& $stsadm_path -o deploysolution -name $solution -immediate -allowgacdeployment -force
if ($? -eq $false) { exit }
ECHO "*** execute admin jobs ***"
& $stsadm_path -o execadmsvcjobs
if ($? -eq $false) { exit }
$feature = $null
ECHO "*****************************************"
ECHO "*** Contoso.Everything ***"
ECHO "*****************************************"
$solution = "Contoso.Everything.wsp"
ECHO "*** add the solution ***"
& $stsadm_path -o addsolution -filename $solution
if ($? -eq $false) { exit }
ECHO "*** execute admin jobs ***"
& $stsadm_path -o execadmsvcjobs
if ($? -eq $false) { exit }
ECHO "*** deploy the solution ***"
& $stsadm_path -o deploysolution -name $solution -immediate -allowgacdeployment -url $url -force
if ($? -eq $false) { exit }
ECHO "*** execute admin jobs ***"
& $stsadm_path -o execadmsvcjobs
if ($? -eq $false) { exit }
$feature = "Contoso.Everything"
ECHO "*** activate feature(s) ***"
& $stsadm_path -o activatefeature -name $feature -url $url -force
if ($? -eq $false) { exit }
ECHO "*** execute admin jobs ***"
& $stsadm_path -o execadmsvcjobs
if ($? -eq $false) { exit }
ECHO "*****************************"
ECHO "*** Contoso.CashMoneyMillionaires ***"
ECHO "*****************************"
$solution = "Contoso.CashMoneyMillionaires.wsp"
ECHO "*** add the solution ***"
& $stsadm_path -o addsolution -filename $solution
if ($? -eq $false) { exit }
ECHO "*** execute admin jobs ***"
& $stsadm_path -o execadmsvcjobs
if ($? -eq $false) { exit }
ECHO "*** deploy the solution ***"
& $stsadm_path -o deploysolution -name $solution -immediate -allowgacdeployment -url $url -force
if ($? -eq $false) { exit }
ECHO "*** execute admin jobs ***"
& $stsadm_path -o execadmsvcjobs
if ($? -eq $false) { exit }
$feature = "Contoso.CashMoneyMillionaires"
ECHO "*** activate feature(s) ***"
& $stsadm_path -o activatefeature -name $feature -url $url -force
if ($? -eq $false) { exit }
ECHO "*** execute admin jobs ***"
& $stsadm_path -o execadmsvcjobs
if ($? -eq $false) { exit }
ECHO "************************************"
ECHO "*** Contoso.DollaDollaBill ***"
ECHO "************************************"
$solution = "Contoso.DollaDollaBill.wsp"
ECHO "*** add the solution ***"
& $stsadm_path -o addsolution -filename $solution
if ($? -eq $false) { exit }
ECHO "*** execute admin jobs ***"
& $stsadm_path -o execadmsvcjobs
if ($? -eq $false) { exit }
ECHO "*** deploy the solution ***"
& $stsadm_path -o deploysolution -name $solution -immediate -allowgacdeployment -url $url -force
if ($? -eq $false) { exit }
ECHO "*** execute admin jobs ***"
& $stsadm_path -o execadmsvcjobs
if ($? -eq $false) { exit }
$feature = "Contoso.DollaDollaBill"
ECHO "*** activate feature(s) ***"
& $stsadm_path -o activatefeature -name $feature -url $url -force
if ($? -eq $false) { exit }
ECHO "*** execute admin jobs ***"
& $stsadm_path -o execadmsvcjobs
if ($? -eq $false) { exit }
ECHO "************************"
ECHO "*** IIS APPPOOL MGMT ***"
ECHO "************************"
ECHO "*** query wmi for apppool ***"
$appPoolName = "SharedServices1"
$appPool = get-wmiobject -namespace "root\MicrosoftIISv2" -class "IIsApplicationPool" | Where-Object {$_.Name -eq "W3SVC/APPPOOLS/$appPoolName"}
if ($? -eq $false) { exit }
ECHO "*** recycle apppool ***"
$appPool.Recycle()
if ($? -eq $false) { exit }
我有一个等效的批处理文件,它也随机失败。它在不同的服务器上失败。我对原因和解决方案感到非常困惑。
任何帮助,将不胜感激。