1

I launched powershell script for restart the entire Farm.
After that, I notice that every time I try to deploy a solution it doesn't finish deploying process. Even if launching Install-SPSolution from PowerShell console.

This is the script code:

 param
    (
        [Parameter(Mandatory=$false, HelpMessage='-ServiceNames Optional, provide a set of service names to restart.')]
        [Array]$ServiceNames=@("SharePoint 2010 Timer","SharePoint 2010 Administration","IIS Admin Service","World Wide Web Publishing Service")
    );

    Write-Host "Attempting to get SharePoint Servers in Farm" -ForegroundColor White;
    $farm = Get-SPFarm;
    $servers = $farm.Servers;
    Write-Host "Found" $servers.Count "Servers in Farm (including database servers)" -ForegroundColor White;
    foreach($server in $servers)
    {
        if($server.Role -ne [Microsoft.SharePoint.Administration.SPServerRole]::Invalid)
        {
            Write-Host "Attempting to restart services on" $server.Name -ForegroundColor White;
            foreach($serviceName in $ServiceNames)
            {
                $serviceInstance = Get-Service -ComputerName $server.Name -Name $serviceName -ErrorAction SilentlyContinue;
                if($serviceInstance -ne $null)
                {
                    Write-Host "Attempting to restart service" $serviceName ".." -ForegroundColor White -NoNewline;
                    try
                    {
                        $restartServiceOutput="";
                        Restart-Service -InputObject $serviceInstance;
                        Write-Host " Done!" -ForegroundColor Green;
                    }
                    catch
                    {
                        Write-Host "Error Occured: " $_.Message;
                    }
                }
            }
        }
    }

this is the output:

Attempting to restart service SharePoint 2010 Administration .. Done!
Attempting to restart service IIS Admin Service ..WARNING: Waiting for service 'IIS Admin Service (IISADMIN)' to finish stopping...
WARNING: Waiting for service 'IIS Admin Service (IISADMIN)' to finish stopping...
 Done!
Attempting to restart service World Wide Web Publishing Service .. Done!
Attempting to restart services on GRISPPMD
Attempting to restart service SharePoint 2010 Timer .. Done!
Attempting to restart service SharePoint 2010 Administration .. Done!
Attempting to restart service IIS Admin Service ..WARNING: Waiting for service 'IIS Admin Service (IISADMIN)' to finish stopping...
WARNING: Waiting for service 'IIS Admin Service (IISADMIN)' to finish stopping...
 Done!
Attempting to restart service World Wide Web Publishing Service ..WARNING: Waiting for service 'World Wide Web Publishing Service (W3SVC)' to finish stopping...
 Done!
Attempting to restart services on GRISPPME
Attempting to restart service SharePoint 2010 Timer ..Restart-Service : Service 'SharePoint 2010 Timer (SPTimerV4)' cannot be started due to the following error: Cannot start service SPTimerV4 on computer 'GRISPPME'.
At line:25 char:36
+                     Restart-Service <<<<  -InputObject $serviceInstance;
    + CategoryInfo          : OpenError: (System.ServiceProcess.ServiceController:ServiceController) [Restart-Service], ServiceCommandException
    + FullyQualifiedErrorId : CouldNotStartService,Microsoft.PowerShell.Commands.RestartServiceCommand

 Done!
Attempting to restart service SharePoint 2010 Administration .. Done!
Attempting to restart service IIS Admin Service ..WARNING: Waiting for service 'IIS Admin Service (IISADMIN)' to finish stopping...
WARNING: Waiting for service 'IIS Admin Service (IISADMIN)' to finish stopping...
 Done!
Attempting to restart service World Wide Web Publishing Service .. Done!
Attempting to restart services on GRISPPMF
Attempting to restart service SharePoint 2010 Timer ..Restart-Service : Service 'SharePoint 2010 Timer (SPTimerV4)' cannot be started due to the following error: Cannot start service SPTimerV4 on computer 'GRISPPMF'.
At line:25 char:36
+                     Restart-Service <<<<  -InputObject $serviceInstance;
    + CategoryInfo          : OpenError: (System.ServiceProcess.ServiceController:ServiceController) [Restart-Service], ServiceCommandException
    + FullyQualifiedErrorId : CouldNotStartService,Microsoft.PowerShell.Commands.RestartServiceCommand

 Done!
Attempting to restart service SharePoint 2010 Administration .. Done!
Attempting to restart service IIS Admin Service ..WARNING: Waiting for service 'IIS Admin Service (IISADMIN)' to finish stopping...
WARNING: Waiting for service 'IIS Admin Service (IISADMIN)' to finish stopping...
 Done!
Attempting to restart service World Wide Web Publishing Service ..WARNING: Waiting for service 'World Wide Web Publishing Service (W3SVC)' to finish stopping...
WARNING: Waiting for service 'World Wide Web Publishing Service (W3SVC)' to finish stopping...
WARNING: Waiting for service 'World Wide Web Publishing Service (W3SVC)' to finish stopping...
WARNING: Waiting for service 'World Wide Web Publishing Service (W3SVC)' to finish stopping...
 Done!

________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________
  • Make sure that SP Timer services as well as SP admin service is running on all servers in the farm. both are responsible for the deployment. – Waqas Sarwar MVP Apr 22 '15 at 15:13
  • All services are running in the entire farm. Sp admin services and SP timer – hello B Apr 23 '15 at 10:10
1

Make sure SharePoint Timer Service is running on all servers.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.