惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

G
Google Developers Blog
阮一峰的网络日志
阮一峰的网络日志
博客园 - 聂微东
F
Fortinet All Blogs
H
Help Net Security
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
D
DataBreaches.Net
MyScale Blog
MyScale Blog
B
Blog
I
InfoQ
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
GbyAI
GbyAI
Google DeepMind News
Google DeepMind News
IT之家
IT之家
The GitHub Blog
The GitHub Blog
有赞技术团队
有赞技术团队
博客园_首页
L
LangChain Blog
V
V2EX
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
T
The Blog of Author Tim Ferriss
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Microsoft Azure Blog
Microsoft Azure Blog
博客园 - Franky

博客园 - 努力学习的小熊

SharePoint - Another Way to Delete Site Collection Exchange - Add Owner of Distribution Group Exchange Online Mailbox Restoration OUTLOOK - Unable to Delete Meetings Outlook Error: The Delegates settings were not saved correctly. Cannot activate send-on-behalf-of list. Office365 OneDrive Geo Move SharePoint Excel Service - Couldn't Open the Workbook. User Get 'Access Denied' with Excel Service WebPart How To Search and Restore files from Site Collection Recycle Bin How To Collect ULS Log from SharePoint Farm How to Operate SharePoint User Alerts with PowerShell How to get Timer Job History Synchronization Service Manager SharePoint 2007 Full Text Searching PowerShell and CS file content with SharePoint Search 0x80040E14 Caused by Max Url Length bug SharePoint 2007 User Re-created in AD with new SID issue on MySite SharePoint 2007 Prompt for Credentials When Accessing FQDN Sites From a Windows Vista or Windows 7 Computer SharePoint 2010 找回丢失的Social Collaboration Web Parts SharePoint 客户端经常弹出Windows验证登录框问题
How To Restart timer service on all servers in farm
努力学习的小熊 · 2015-12-11 · via 博客园 - 努力学习的小熊

2015-12-11 15:11  努力学习的小熊  阅读(411)  评论()    收藏  举报

[array]$servers= Get-SPServer | ? {$_.Role -eq "Application"}            
$farm = Get-SPFarm            
foreach ($server in $servers)            
{            
    Write-Host "Restarting Timer Job on $server"                                      
    $Service = Get-WmiObject -Computer $server.name Win32_Service -Filter "Name='SPTimerV4'"                        
    if ($Service -ne $null)                         
    {                             
        $Service.InvokeMethod('StopService',$null)            
        Start-Sleep -s 7            
        $service.InvokeMethod('StartService',$null)                             
        Start-Sleep -s 7            
        Write-Host "Timer Job successfully restarted on $server"                        
    }             
    else            
    {            
        write-host -ForegroundColor Yellow "Could not find SharePoint 2010 Timer Service on $server"            
    }            
}